X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.repo%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Frepo%2Fosgi%2FNormalizeGroup.java;fp=runtime%2Forg.argeo.slc.repo%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Frepo%2Fosgi%2FNormalizeGroup.java;h=144c15987f6e6f9c3a5cb6f3927757f6a690f3f6;hb=e146631736be22397edf93f81f3218b5a178dc06;hp=57cc1145c9f2e909b6c4f5c8d47f5dee19bce35d;hpb=5f85c8d54a21fc3ab5029c43aa3f70dbcd427614;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/osgi/NormalizeGroup.java b/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/osgi/NormalizeGroup.java index 57cc1145c..144c15987 100644 --- a/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/osgi/NormalizeGroup.java +++ b/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/osgi/NormalizeGroup.java @@ -59,8 +59,10 @@ public class NormalizeGroup implements Runnable, SlcNames { private String workspace; private String groupId; private String artifactBasePath = "/"; - private String version = "1.3.0"; - private String parentPomCoordinates = "org.argeo:parent:1.3.0"; + private String version = null;// = "1.3.0"; + private String parentPomCoordinates;// = "org.argeo:parent:1.3.0"; + + private List excludedSuffixes = new ArrayList(); private ArtifactIndexer artifactIndexer = new ArtifactIndexer(); private JarFileIndexer jarFileIndexer = new JarFileIndexer(); @@ -155,8 +157,10 @@ public class NormalizeGroup implements Runnable, SlcNames { Set artifacts) throws RepositoryException { Artifact artifact = new DefaultArtifact(groupId, artifactId, "pom", version); + Artifact parentArtifact = parentPomCoordinates != null ? new DefaultArtifact( + parentPomCoordinates) : null; String pom = MavenConventionsUtils.artifactsAsDependencyPom(artifact, - artifacts, new DefaultArtifact(parentPomCoordinates)); + artifacts, parentArtifact); Node node = RepoUtils.copyBytesAsArtifact( session.getNode(artifactBasePath), artifact, pom.getBytes()); artifactIndexer.index(node); @@ -178,6 +182,12 @@ public class NormalizeGroup implements Runnable, SlcNames { if (symbolicName.endsWith(".source")) { // TODO make a shared node with classifier 'sources' + String bundleName = RepoUtils + .extractBundleNameFromSourceName(symbolicName); + for (String excludedSuffix : excludedSuffixes) { + if (bundleName.endsWith(excludedSuffix)) + return;// skip adding to sources + } sources.add(RepoUtils.asArtifact(bundleNode)); return; } @@ -191,6 +201,10 @@ public class NormalizeGroup implements Runnable, SlcNames { } symbolicNamesToNodes.put(symbolicName, bundleNode); + for (String excludedSuffix : excludedSuffixes) { + if (symbolicName.endsWith(excludedSuffix)) + return;// skip adding to binaries + } binaries.add(RepoUtils.asArtifact(bundleNode)); } @@ -355,4 +369,16 @@ public class NormalizeGroup implements Runnable, SlcNames { this.parentPomCoordinates = parentPomCoordinates; } + public void setArtifactBasePath(String artifactBasePath) { + this.artifactBasePath = artifactBasePath; + } + + public void setVersion(String version) { + this.version = version; + } + + public void setExcludedSuffixes(List excludedSuffixes) { + this.excludedSuffixes = excludedSuffixes; + } + }