]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/maven/MavenConventionsUtils.java
Exclude some Argeo customers
[gpl/argeo-slc.git] / runtime / org.argeo.slc.repo / src / main / java / org / argeo / slc / repo / maven / MavenConventionsUtils.java
index a19e0725a6fafa08bf55daba74f5c61f3dba3f68..06be9eca39a6f863ae29f0d211df139a2944846c 100644 (file)
@@ -89,16 +89,25 @@ public class MavenConventionsUtils {
        }
 
        public static String artifactsAsDependencyPom(Artifact pomArtifact,
-                       Set<Artifact> artifacts) {
+                       Set<Artifact> artifacts, Artifact parent) {
                StringBuffer p = new StringBuffer();
 
                // XML header
                p.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
                p.append("<project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\">\n");
-               p.append("<modelVersion>4.0.0</modelVersion>");
+               p.append("<modelVersion>4.0.0</modelVersion>\n");
 
                // Artifact
-               p.append("<parent><groupId>org.argeo</groupId><artifactId>parent</artifactId><version>1.2.0</version></parent>\n");
+               if (parent != null) {
+                       p.append("<parent>\n");
+                       p.append("<groupId>").append(parent.getGroupId())
+                                       .append("</groupId>\n");
+                       p.append("<artifactId>").append(parent.getArtifactId())
+                                       .append("</artifactId>\n");
+                       p.append("<version>").append(parent.getVersion())
+                                       .append("</version>\n");
+                       p.append("</parent>\n");
+               }
                p.append("<groupId>").append(pomArtifact.getGroupId())
                                .append("</groupId>\n");
                p.append("<artifactId>").append(pomArtifact.getArtifactId())
@@ -139,9 +148,9 @@ public class MavenConventionsUtils {
                p.append("</dependencyManagement>\n");
 
                // Repositories
-               p.append("<repositories>\n");
-               p.append("<repository><id>argeo</id><url>http://maven.argeo.org/argeo</url></repository>\n");
-               p.append("</repositories>\n");
+//             p.append("<repositories>\n");
+//             p.append("<repository><id>argeo</id><url>http://maven.argeo.org/argeo</url></repository>\n");
+//             p.append("</repositories>\n");
 
                p.append("</project>\n");
                return p.toString();