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
This commit is contained in:
kohsuke committed 2007-01-22 05:57:51 +00:00
1 parent 6d9d54b760
commit 8a7575fdc0
4 files changed
+12 -43

No files matched your search

@@ -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<MavenModule,MavenBuild> i
}
protected void doSetName(String name) {
super.doSetName(name);
moduleName = ModuleName.fromFileSystemName(name);
super.doSetName(moduleName.toString());
}
@Override
public void onLoad(ItemGroup<? extends Item> parent, String name) throws IOException {
super.onLoad(parent, name);
super.onLoad(parent,name);
if(reporters==null)
reporters = new DescribableList<MavenReporter, Descriptor<MavenReporter>>(this);
reporters.setOwner(this);
@@ -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<MavenModule> getAllJobs() {
+6 -1
View File
@@ -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<? extends Item> 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.
*/