From 8a7575fdc000fcf058d307d49e79f37cb15fa8ad Mon Sep 17 00:00:00 2001 From: kohsuke Date: Mon, 22 Jan 2007 05:57:51 +0000 Subject: [PATCH] modified so that MavenModule.getName() returns "groupId:artifactId" format, while on the disk it uses "groupId$artifactId" format. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@1873 71c3de6d-444a-0410-be80-ed276b4c234a --- .../main/java/hudson/maven/MavenModule.java | 9 ++--- .../java/hudson/maven/MavenModuleSet.java | 2 +- core/src/main/java/hudson/model/Item.java | 7 +++- .../hudson/maven/MavenModuleSet/index.jelly | 37 +------------------ 4 files changed, 12 insertions(+), 43 deletions(-) diff --git a/core/src/main/java/hudson/maven/MavenModule.java b/core/src/main/java/hudson/maven/MavenModule.java index 002b07d367..2fc39ea6b1 100644 --- a/core/src/main/java/hudson/maven/MavenModule.java +++ b/core/src/main/java/hudson/maven/MavenModule.java @@ -4,14 +4,13 @@ import hudson.FilePath; import hudson.model.AbstractProject; import hudson.model.Descriptor; import hudson.model.Descriptor.FormException; -import hudson.model.Items; -import hudson.model.Job; import hudson.model.Item; import hudson.model.ItemGroup; +import hudson.model.Job; import hudson.util.DescribableList; +import org.apache.maven.project.MavenProject; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerResponse; -import org.apache.maven.project.MavenProject; import javax.servlet.ServletException; import java.io.File; @@ -47,13 +46,13 @@ public final class MavenModule extends AbstractProject i } protected void doSetName(String name) { - super.doSetName(name); moduleName = ModuleName.fromFileSystemName(name); + super.doSetName(moduleName.toString()); } @Override public void onLoad(ItemGroup parent, String name) throws IOException { - super.onLoad(parent, name); + super.onLoad(parent,name); if(reporters==null) reporters = new DescribableList>(this); reporters.setOwner(this); diff --git a/core/src/main/java/hudson/maven/MavenModuleSet.java b/core/src/main/java/hudson/maven/MavenModuleSet.java index b44214d635..0a125f6b94 100644 --- a/core/src/main/java/hudson/maven/MavenModuleSet.java +++ b/core/src/main/java/hudson/maven/MavenModuleSet.java @@ -144,7 +144,7 @@ public class MavenModuleSet extends AbstractItem implements TopLevelItem, ItemGr } public File getRootDirFor(MavenModule child) { - return new File(new File(getRootDir(),"modules"),child.getName()); + return new File(new File(getRootDir(),"modules"),child.getModuleName().toFileSystemName()); } public Collection getAllJobs() { diff --git a/core/src/main/java/hudson/model/Item.java b/core/src/main/java/hudson/model/Item.java index 2e27268ea2..c2a9c2b189 100644 --- a/core/src/main/java/hudson/model/Item.java +++ b/core/src/main/java/hudson/model/Item.java @@ -78,6 +78,11 @@ public interface Item extends PersistenceRoot { /** * Called right after when a {@link Item} is loaded from disk. * This is an opporunity to do a post load processing. + * + * @param name + * Name of the directory (not a path --- just the name portion) from + * which the configuration was loaded. This usually becomes the + * {@link #getName() name} of this item. */ void onLoad(ItemGroup parent, String name) throws IOException; @@ -92,7 +97,7 @@ public interface Item extends PersistenceRoot { /** * Save the settings to a file. * - * Use {@link ItemLoader#getConfigFile(Item)} + * Use {@link Items#getConfigFile(Item)} * or {@link AbstractItem#getConfigFile()} to obtain the file * to save the data. */ diff --git a/core/src/main/resources/hudson/maven/MavenModuleSet/index.jelly b/core/src/main/resources/hudson/maven/MavenModuleSet/index.jelly index 05780c651b..cd184b7846 100644 --- a/core/src/main/resources/hudson/maven/MavenModuleSet/index.jelly +++ b/core/src/main/resources/hudson/maven/MavenModuleSet/index.jelly @@ -5,42 +5,7 @@

Project ${it.name}

- - -

Modules

- - -

Permalinks

- + \ No newline at end of file