This is an automated email from the ASF dual-hosted git repository. alien11689 pushed a commit to branch update-bndlib-artifact-name-in-plugins in repository https://gitbox.apache.org/repos/asf/aries.git
commit a5cdbe8656f79565b03131d06cd4db172074d62b Author: Dominik Przybysz <[email protected]> AuthorDate: Fri Feb 28 16:27:00 2025 +0100 [MAINTENANCE] Update bndlib artifact name in plugins --- eba-maven-plugin/pom.xml | 12 ++--- .../java/org/apache/aries/plugin/eba/EbaMojo.java | 52 +++++++++++----------- esa-maven-plugin/pom.xml | 12 ++--- .../org/apache/aries/plugin/esa/ContentInfo.java | 2 +- .../java/org/apache/aries/plugin/esa/EsaMojo.java | 3 +- .../org/apache/aries/plugin/esa/EsaMojoTest.java | 4 +- 6 files changed, 43 insertions(+), 42 deletions(-) diff --git a/eba-maven-plugin/pom.xml b/eba-maven-plugin/pom.xml index 1a746af31..6ba1d600e 100644 --- a/eba-maven-plugin/pom.xml +++ b/eba-maven-plugin/pom.xml @@ -24,7 +24,7 @@ <parent> <groupId>org.apache.aries</groupId> <artifactId>parent</artifactId> - <version>2.0.1</version> + <version>2.1.2-SNAPSHOT</version> <relativePath>../parent/pom.xml</relativePath> </parent> @@ -42,10 +42,10 @@ </scm> <properties> - <bndlib.version>0.0.357</bndlib.version> + <biz.aQute.bndlib.version>6.4.1</biz.aQute.bndlib.version> <maven-archiver.version>2.3</maven-archiver.version> <maven-artifact.version>2.0.4</maven-artifact.version> - <maven-bundle-plugin.version>2.0.0</maven-bundle-plugin.version> + <maven-bundle-plugin.version>5.1.9</maven-bundle-plugin.version> <maven-invoker-plugin.version>3.9.0</maven-invoker-plugin.version> <maven-model.version>3.9.9</maven-model.version> <maven-plugin-api.version>2.0</maven-plugin-api.version> @@ -58,9 +58,9 @@ <dependencies> <dependency> - <groupId>biz.aQute</groupId> - <artifactId>bndlib</artifactId> - <version>${bndlib.version}</version> + <groupId>biz.aQute.bnd</groupId> + <artifactId>biz.aQute.bndlib</artifactId> + <version>${biz.aQute.bndlib.version}</version> </dependency> <dependency> <groupId>org.apache.felix</groupId> diff --git a/eba-maven-plugin/src/main/java/org/apache/aries/plugin/eba/EbaMojo.java b/eba-maven-plugin/src/main/java/org/apache/aries/plugin/eba/EbaMojo.java index 3ea7f5bc2..c68bc8057 100644 --- a/eba-maven-plugin/src/main/java/org/apache/aries/plugin/eba/EbaMojo.java +++ b/eba-maven-plugin/src/main/java/org/apache/aries/plugin/eba/EbaMojo.java @@ -31,7 +31,7 @@ import org.codehaus.plexus.util.DirectoryScanner; import org.codehaus.plexus.util.FileUtils; import org.apache.maven.shared.osgi.DefaultMaven2OsgiConverter; import org.apache.maven.shared.osgi.Maven2OsgiConverter; -import aQute.lib.osgi.Analyzer; +import aQute.bnd.osgi.Analyzer; import java.io.File; import java.io.IOException; import java.util.Iterator; @@ -52,7 +52,7 @@ public class EbaMojo extends AbstractMojo { - + public static final String APPLICATION_MF_URI = "META-INF/APPLICATION.MF"; private static final String[] DEFAULT_INCLUDES = {"**/**"}; @@ -70,12 +70,12 @@ public class EbaMojo private static final String APPLICATION_EXPORTSERVICE = "Application-ExportService"; private static final String APPLICATION_IMPORTSERVICE = "Application-ImportService"; private static final String APPLICATION_USEBUNDLE = "Use-Bundle"; - + /** * Coverter for maven pom values to OSGi manifest values (pulled in from the maven-bundle-plugin) */ private Maven2OsgiConverter maven2OsgiConverter = new DefaultMaven2OsgiConverter(); - + /** * Single directory for extra files to include in the eba. * @@ -167,8 +167,8 @@ public class EbaMojo * * @parameter */ - private Map instructions = new LinkedHashMap();; - + private Map instructions = new LinkedHashMap();; + /** * Adding pom.xml and pom.properties to the archive. * @@ -199,9 +199,9 @@ public class EbaMojo /** * Define which bundles to include in the archive. - * none - no bundles are included + * none - no bundles are included * applicationContent - direct dependencies go into the content - * all - direct and transitive dependencies go into the content + * all - direct and transitive dependencies go into the content * * @parameter expression="${archiveContent}" default-value="applicationContent" */ @@ -226,10 +226,10 @@ public class EbaMojo if (archiveContent == null) { archiveContent = new String("applicationContent"); } - - getLog().debug( "archiveContent[" + archiveContent + "]" ); - getLog().info( "archiveContent[" + archiveContent + "]" ); - + + getLog().debug( "archiveContent[" + archiveContent + "]" ); + getLog().info( "archiveContent[" + archiveContent + "]" ); + zipArchiver.setIncludeEmptyDirs( includeEmptyDirs ); zipArchiver.setCompress( true ); zipArchiver.setForced( forceCreation ); @@ -258,19 +258,19 @@ public class EbaMojo // if use transitive is set (i.e. true) then we need to make sure archiveContent does not contradict (i.e. is set // to the same compatible value or is the default). if ("none".equals(archiveContent)) { - throw new MojoExecutionException("<useTransitiveDependencies/> and <archiveContent/> incompatibly configured. <useTransitiveDependencies/> is deprecated in favor of <archiveContent/>." ); + throw new MojoExecutionException("<useTransitiveDependencies/> and <archiveContent/> incompatibly configured. <useTransitiveDependencies/> is deprecated in favor of <archiveContent/>." ); } else { - artifacts = project.getArtifacts(); + artifacts = project.getArtifacts(); } } else { // check that archiveContent is compatible if ("applicationContent".equals(archiveContent)) { - artifacts = project.getDependencyArtifacts(); + artifacts = project.getDependencyArtifacts(); } else { // the only remaining options should be applicationContent="none" - getLog().info("archiveContent=none: application arvhive will not contain any bundles."); + getLog().info("archiveContent=none: application arvhive will not contain any bundles."); } } if (artifacts != null) { @@ -282,7 +282,7 @@ public class EbaMojo artifact.getScope() + "]"); zipArchiver.addFile(artifact.getFile(), artifact.getArtifactId() + "-" + artifact.getVersion() + "." + (artifact.getType() == null ? "jar" : artifact.getType())); } - } + } } } catch ( ArchiverException e ) @@ -362,7 +362,7 @@ public class EbaMojo "Error generating APPLICATION.MF file: " + fileName, e); } } - + // Check if connector deployment descriptor is there File ddFile = new File( getBuildDir(), APPLICATION_MF_URI); if ( !ddFile.exists() ) @@ -480,7 +480,7 @@ public class EbaMojo } } - + // The maven2OsgiConverter assumes the artifact is a jar so we need our own // This uses the same fallback scheme as the converter private String getApplicationSymbolicName(Artifact artifact) { @@ -489,14 +489,14 @@ public class EbaMojo } return artifact.getGroupId() + "." + artifact.getArtifactId(); } - + private String getApplicationVersion() { if (instructions.containsKey(APPLICATION_VERSION)) { return instructions.get(APPLICATION_VERSION).toString(); } - return aQute.lib.osgi.Analyzer.cleanupVersion(project.getVersion()); + return Analyzer.cleanupVersion(project.getVersion()); } - + protected File getBuildDir() { if ( buildDir == null ) @@ -519,16 +519,16 @@ public class EbaMojo FileUtils.copyFileToDirectory( appMfFile, metaInfDir); } } - + /** - * Return artifacts in 'compile' or 'runtime' scope only. + * Return artifacts in 'compile' or 'runtime' scope only. */ - private Set<Artifact> selectArtifacts(Set<Artifact> artifacts) + private Set<Artifact> selectArtifacts(Set<Artifact> artifacts) { Set<Artifact> selected = new LinkedHashSet<Artifact>(); for (Artifact artifact : artifacts) { String scope = artifact.getScope(); - if (scope == null + if (scope == null || Artifact.SCOPE_COMPILE.equals(scope) || Artifact.SCOPE_RUNTIME.equals(scope)) { selected.add(artifact); diff --git a/esa-maven-plugin/pom.xml b/esa-maven-plugin/pom.xml index 8db1f951b..cff224047 100644 --- a/esa-maven-plugin/pom.xml +++ b/esa-maven-plugin/pom.xml @@ -24,7 +24,7 @@ <parent> <groupId>org.apache.aries</groupId> <artifactId>parent</artifactId> - <version>2.0.0</version> + <version>2.1.2-SNAPSHOT</version> <relativePath>../parent/pom.xml</relativePath> </parent> @@ -42,10 +42,10 @@ </scm> <properties> - <bndlib.version>0.0.357</bndlib.version> + <biz.aQute.bndlib.version>6.4.1</biz.aQute.bndlib.version> <maven-archiver.version>2.3</maven-archiver.version> <maven-artifact.version>2.0.4</maven-artifact.version> - <maven-bundle-plugin.version>2.0.0</maven-bundle-plugin.version> + <maven-bundle-plugin.version>5.1.9</maven-bundle-plugin.version> <maven-model.version>3.9.9</maven-model.version> <maven-plugin-api.version>2.0</maven-plugin-api.version> <maven-plugin-testing-harness.version>1.1</maven-plugin-testing-harness.version> @@ -63,9 +63,9 @@ <version>${org.apache.aries.util.version}</version> </dependency> <dependency> - <groupId>biz.aQute</groupId> - <artifactId>bndlib</artifactId> - <version>${bndlib.version}</version> + <groupId>biz.aQute.bnd</groupId> + <artifactId>biz.aQute.bndlib</artifactId> + <version>${biz.aQute.bndlib.version}</version> </dependency> <dependency> <groupId>org.apache.felix</groupId> diff --git a/esa-maven-plugin/src/main/java/org/apache/aries/plugin/esa/ContentInfo.java b/esa-maven-plugin/src/main/java/org/apache/aries/plugin/esa/ContentInfo.java index 721e8d77f..1ca204851 100644 --- a/esa-maven-plugin/src/main/java/org/apache/aries/plugin/esa/ContentInfo.java +++ b/esa-maven-plugin/src/main/java/org/apache/aries/plugin/esa/ContentInfo.java @@ -27,7 +27,7 @@ import java.util.jar.Manifest; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; -import aQute.lib.osgi.Analyzer; +import aQute.bnd.osgi.Analyzer; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.versioning.VersionRange; diff --git a/esa-maven-plugin/src/main/java/org/apache/aries/plugin/esa/EsaMojo.java b/esa-maven-plugin/src/main/java/org/apache/aries/plugin/esa/EsaMojo.java index 8d766f816..b27ec8a02 100644 --- a/esa-maven-plugin/src/main/java/org/apache/aries/plugin/esa/EsaMojo.java +++ b/esa-maven-plugin/src/main/java/org/apache/aries/plugin/esa/EsaMojo.java @@ -30,6 +30,7 @@ import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; +import aQute.bnd.osgi.Analyzer; import org.apache.aries.util.manifest.BundleManifest; import org.apache.maven.archiver.PomPropertiesUtil; import org.apache.maven.artifact.Artifact; @@ -504,7 +505,7 @@ public class EsaMojo if (instructions.containsKey(Constants.SUBSYSTEM_VERSION)) { return instructions.get(Constants.SUBSYSTEM_VERSION).toString(); } - return aQute.lib.osgi.Analyzer.cleanupVersion(project.getVersion()); + return Analyzer.cleanupVersion(project.getVersion()); } private String getSubsystemName() { diff --git a/esa-maven-plugin/src/test/java/org/apache/aries/plugin/esa/EsaMojoTest.java b/esa-maven-plugin/src/test/java/org/apache/aries/plugin/esa/EsaMojoTest.java index 94460ae75..36a66ec42 100644 --- a/esa-maven-plugin/src/test/java/org/apache/aries/plugin/esa/EsaMojoTest.java +++ b/esa-maven-plugin/src/test/java/org/apache/aries/plugin/esa/EsaMojoTest.java @@ -34,7 +34,7 @@ import org.apache.maven.plugin.testing.AbstractMojoTestCase; import org.codehaus.plexus.archiver.zip.ZipEntry; import org.codehaus.plexus.archiver.zip.ZipFile; -import aQute.lib.osgi.Analyzer; +import aQute.bnd.osgi.Analyzer; /** * @author <a href="mailto:[email protected]">Allan Ramirez</a> @@ -227,7 +227,7 @@ public class EsaMojoTest Attributes attributes = mf.getMainAttributes(); String value = attributes.getValue(header); assertNotNull("Header " + header + " not found", value); - return Analyzer.parseHeader(value, null); + return Analyzer.parseHeader(value, null).toBasic(); } private void testForHeader(ZipFile esa, String header, String exactEntry) throws Exception {
