mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-18 06:22:29 +00:00
modified to record version number of MavenModule
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@7878 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
02c72cf7ea
commit
bd43c38966
3 files changed
+31
-1
No files matched your search
@@ -47,6 +47,15 @@ public final class MavenModule extends AbstractMavenProject<MavenModule,MavenBui
|
||||
*/
|
||||
private String displayName;
|
||||
|
||||
/**
|
||||
* Version number of this module as of fhe last build, taken from {@link MavenProject#getVersion()}.
|
||||
*
|
||||
* This field can be null if Hudson loaded old data
|
||||
* that didn't record this information, so that situation
|
||||
* needs to be handled gracefully.
|
||||
*/
|
||||
private String version;
|
||||
|
||||
private transient ModuleName moduleName;
|
||||
|
||||
private String relativePath;
|
||||
@@ -114,6 +123,7 @@ public final class MavenModule extends AbstractMavenProject<MavenModule,MavenBui
|
||||
*/
|
||||
/*package*/ final void reconfigure(PomInfo pom) {
|
||||
this.displayName = pom.displayName;
|
||||
this.version = pom.version;
|
||||
this.relativePath = pom.relativePath;
|
||||
this.dependencies = pom.dependencies;
|
||||
this.children = pom.children;
|
||||
@@ -158,6 +168,18 @@ public final class MavenModule extends AbstractMavenProject<MavenModule,MavenBui
|
||||
return relativePath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the version number in Maven POM as of the last build.
|
||||
*
|
||||
* @return
|
||||
* This method can return null if Hudson loaded old data
|
||||
* that didn't record this information, so that situation
|
||||
* needs to be handled gracefully.
|
||||
*/
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the list of goals to execute for this module.
|
||||
*/
|
||||
|
||||
@@ -43,6 +43,13 @@ final class PomInfo implements Serializable {
|
||||
*/
|
||||
public final String relativePath;
|
||||
|
||||
/**
|
||||
* Version number taken from POM.
|
||||
*
|
||||
* @see MavenProject#getVersion()
|
||||
*/
|
||||
public final String version;
|
||||
|
||||
/**
|
||||
* Dependency of this project.
|
||||
*
|
||||
@@ -69,6 +76,7 @@ final class PomInfo implements Serializable {
|
||||
|
||||
public PomInfo(MavenProject project, PomInfo parent, String relPath) {
|
||||
this.name = new ModuleName(project);
|
||||
this.version = project.getVersion();
|
||||
this.displayName = project.getName();
|
||||
this.defaultGoal = project.getDefaultGoal();
|
||||
this.relativePath = relPath;
|
||||
|
||||
Reference in new issue
Block a user