From 577bd663b34c34ef42747ffd54bc367c526aa423 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Sun, 21 Jan 2007 21:22:19 +0000 Subject: [PATCH] added code to parse POMs and build MavenModules. how to integrate this into website and when to do this still needs some more thinking. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@1863 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/maven/MavenModule.java | 2 +- core/src/main/java/hudson/maven/ModuleName.java | 8 ++++++++ .../hudson/maven/MavenModuleSet/parsePOM.jelly | 14 ++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 core/src/main/resources/hudson/maven/MavenModuleSet/parsePOM.jelly diff --git a/core/src/main/java/hudson/maven/MavenModule.java b/core/src/main/java/hudson/maven/MavenModule.java index 7e0c0580b2..16cd200ee8 100644 --- a/core/src/main/java/hudson/maven/MavenModule.java +++ b/core/src/main/java/hudson/maven/MavenModule.java @@ -33,7 +33,7 @@ public final class MavenModule extends AbstractProject i private String displayName; /*package*/ MavenModule(MavenModuleSet parent, PomInfo pom) { - super(parent, pom.name.toString()); + super(parent, pom.name.toFileSystemName()); displayName = pom.displayName; } diff --git a/core/src/main/java/hudson/maven/ModuleName.java b/core/src/main/java/hudson/maven/ModuleName.java index fe1935b6fd..f237907007 100644 --- a/core/src/main/java/hudson/maven/ModuleName.java +++ b/core/src/main/java/hudson/maven/ModuleName.java @@ -21,6 +21,14 @@ public class ModuleName { return groupId+':'+artifactId; } + /** + * Returns the "groupId$artifactId" form, + * which is safe for the use as a file name, unlike {@link #toString()}. + */ + public String toFileSystemName() { + return groupId+'$'+artifactId; + } + public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; diff --git a/core/src/main/resources/hudson/maven/MavenModuleSet/parsePOM.jelly b/core/src/main/resources/hudson/maven/MavenModuleSet/parsePOM.jelly new file mode 100644 index 0000000000..24803b4f8d --- /dev/null +++ b/core/src/main/resources/hudson/maven/MavenModuleSet/parsePOM.jelly @@ -0,0 +1,14 @@ + + + + +

Parsing POM

+ +

+      
+ +
+ +
+
+
\ No newline at end of file