X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.repo%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Frepo%2Fmaven%2FImportMavenDependencies.java;h=d1245ff956ddb381481446974ee6df1f21dee546;hb=399702cec859f48ec171c30d268c55eb632d472a;hp=0bda72b7e87e91d272eaa86e0cf7d5b99f767345;hpb=418a82cb85b477af9f2b8d850ca14c8512546643;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/maven/ImportMavenDependencies.java b/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/maven/ImportMavenDependencies.java index 0bda72b7e..d1245ff95 100644 --- a/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/maven/ImportMavenDependencies.java +++ b/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/maven/ImportMavenDependencies.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2012 Mathieu Baudier + * Copyright (C) 2007-2012 Argeo GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ import org.argeo.jcr.JcrUtils; import org.argeo.slc.NameVersion; import org.argeo.slc.SlcException; import org.argeo.slc.aether.AetherTemplate; +import org.argeo.slc.aether.ArtifactIdComparator; import org.argeo.slc.repo.ArtifactIndexer; import org.argeo.slc.repo.JarFileIndexer; import org.argeo.slc.repo.RepoConstants; @@ -55,20 +56,17 @@ public class ImportMavenDependencies implements Runnable { private AetherTemplate aetherTemplate; private String rootCoordinates = "org.argeo.dep:versions-all:pom:1.2.0"; private String distCoordinates = "org.argeo.tp:dist:pom:1.3.0"; + private String parentPomCoordinates = "org.argeo:parent:1.2.0"; private Set excludedArtifacts = new HashSet(); private Repository repository; private String workspace; - private String artifactBasePath = RepoConstants.ARTIFACTS_BASE_PATH; + private String artifactBasePath = RepoConstants.DEFAULT_ARTIFACTS_BASE_PATH; private ArtifactIndexer artifactIndexer = new ArtifactIndexer(); private JarFileIndexer jarFileIndexer = new JarFileIndexer(); - private Comparator artifactComparator = new Comparator() { - public int compare(Artifact o1, Artifact o2) { - return o1.getArtifactId().compareTo(o2.getArtifactId()); - } - }; + private Comparator artifactComparator = new ArtifactIdComparator(); public void run() { // resolve @@ -91,7 +89,7 @@ public class ImportMavenDependencies implements Runnable { node.remove(); } session.save(); - + // sync syncDistribution(session, artifacts); } catch (Exception e) { @@ -115,7 +113,8 @@ public class ImportMavenDependencies implements Runnable { registeredArtifacts, pomArtifact); Artifact sdkArtifact = new DefaultArtifact(distCoordinates); String sdkPom = MavenConventionsUtils.artifactsAsDependencyPom( - sdkArtifact, registeredArtifacts); + sdkArtifact, registeredArtifacts, new DefaultArtifact( + parentPomCoordinates)); if (log.isDebugEnabled()) log.debug("Gathered " + registeredArtifacts.size() + " artifacts:\n" + sdkPom);