From 899a5404c83cc67a53844f07d6dac49b9ab83a0d Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Thu, 29 Nov 2018 12:42:46 +0000 Subject: [PATCH 1/9] Expand conditionals --- maven-plugin-bundle.spec | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/maven-plugin-bundle.spec b/maven-plugin-bundle.spec index eb829bc..2206e14 100644 --- a/maven-plugin-bundle.spec +++ b/maven-plugin-bundle.spec @@ -1,8 +1,3 @@ -%if 0%{?fedora} -%bcond_without obr -%bcond_without reporting -%endif - %global site_name maven-bundle-plugin Name: maven-plugin-bundle @@ -37,17 +32,6 @@ BuildRequires: mvn(org.apache.maven.shared:maven-dependency-tree) BuildRequires: mvn(org.codehaus.plexus:plexus-utils) BuildRequires: mvn(org.osgi:osgi.core) BuildRequires: mvn(org.sonatype.plexus:plexus-build-api) -%if %{with obr} -BuildRequires: mvn(net.sf.kxml:kxml2) -BuildRequires: mvn(org.apache.felix:org.apache.felix.bundlerepository) -BuildRequires: mvn(xpp3:xpp3) -%endif -%if %{with reporting} -BuildRequires: mvn(org.apache.maven.doxia:doxia-core) -BuildRequires: mvn(org.apache.maven.doxia:doxia-sink-api) -BuildRequires: mvn(org.apache.maven.doxia:doxia-site-renderer) -BuildRequires: mvn(org.apache.maven.reporting:maven-reporting-impl) -%endif %description Provides a maven plugin that supports creating an OSGi bundle @@ -81,21 +65,13 @@ rm -r src/main/java/org/apache/felix/bundleplugin/pom # There is forked version of maven-osgi in # src/{main,test}/java/org/apache/maven -%if %{with obr} -# Deps unbundled from felix-bundlerepository -%pom_add_dep xpp3:xpp3 -%pom_add_dep net.sf.kxml:kxml2 -%else rm -rf src/main/java/org/apache/felix/obrplugin/ %pom_remove_dep :org.apache.felix.bundlerepository -%endif -%if %{without reporting} rm -f src/main/java/org/apache/felix/bundleplugin/baseline/BaselineReport.java %pom_remove_dep :doxia-sink-api %pom_remove_dep :doxia-site-renderer %pom_remove_dep :maven-reporting-impl -%endif %build # Tests depend on bundled JARs From 95325206acad87402eef1952295e8088632ca06c Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Fri, 24 May 2019 17:01:10 +0200 Subject: [PATCH 2/9] Mass rebuild for javapackages-tools 201901 --- maven-plugin-bundle.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/maven-plugin-bundle.spec b/maven-plugin-bundle.spec index 2206e14..654bdb5 100644 --- a/maven-plugin-bundle.spec +++ b/maven-plugin-bundle.spec @@ -2,7 +2,7 @@ Name: maven-plugin-bundle Version: 3.5.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Maven Bundle Plugin License: ASL 2.0 URL: http://felix.apache.org @@ -87,6 +87,9 @@ rm -f src/main/java/org/apache/felix/bundleplugin/baseline/BaselineReport.java %doc LICENSE NOTICE %changelog +* Fri May 24 2019 Mikolaj Izdebski - 3.5.0-3 +- Mass rebuild for javapackages-tools 201901 + * Thu Feb 08 2018 Fedora Release Engineering - 3.5.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild From 2446116bd2f15d521c3a87cdec79e5052efff864 Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Tue, 4 Jun 2019 13:14:00 +0200 Subject: [PATCH 3/9] Update to upstream version 4.2.0 --- .gitignore | 1 + ...ort-to-current-maven-dependency-tree.patch | 365 +++++++++--------- 0002-Fix-for-new-maven-archiver.patch | 36 +- 0003-Port-to-plexus-utils-3.0.24.patch | 64 +-- 0004-Use-Maven-3-APIs.patch | 93 ++--- maven-plugin-bundle.spec | 14 +- sources | 2 +- 7 files changed, 275 insertions(+), 300 deletions(-) diff --git a/.gitignore b/.gitignore index d0ca595..5ac4c75 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ maven-bundle-plugin-2.0.0-project.tar.gz /maven-bundle-plugin-3.3.0-source-release.tar.gz /maven-bundle-plugin-3.4.0-source-release.tar.gz /maven-bundle-plugin-3.5.0-source-release.tar.gz +/maven-bundle-plugin-4.2.0-source-release.tar.gz diff --git a/0001-Port-to-current-maven-dependency-tree.patch b/0001-Port-to-current-maven-dependency-tree.patch index 82e45b8..77db78f 100644 --- a/0001-Port-to-current-maven-dependency-tree.patch +++ b/0001-Port-to-current-maven-dependency-tree.patch @@ -13,243 +13,236 @@ diff --git a/pom.xml b/pom.xml index dfbf237..46b2ba6 100644 --- a/pom.xml +++ b/pom.xml -@@ -189,7 +189,7 @@ - - org.apache.maven.shared - maven-dependency-tree -- 2.1 +@@ -192,7 +192,7 @@ + + org.apache.maven.shared + maven-dependency-tree +- 2.1 + 3.0 - - - org.codehaus.plexus + + + org.codehaus.plexus diff --git a/src/main/java/org/apache/felix/bundleplugin/BundleAllPlugin.java b/src/main/java/org/apache/felix/bundleplugin/BundleAllPlugin.java index f3b5509..6591923 100644 --- a/src/main/java/org/apache/felix/bundleplugin/BundleAllPlugin.java +++ b/src/main/java/org/apache/felix/bundleplugin/BundleAllPlugin.java @@ -21,8 +21,10 @@ package org.apache.felix.bundleplugin; - - import java.io.File; - import java.io.FilenameFilter; + + import java.io.File; + import java.io.FilenameFilter; +import java.util.ArrayDeque; - import java.util.Arrays; - import java.util.Collection; + import java.util.Arrays; + import java.util.Collection; +import java.util.Deque; - import java.util.HashSet; - import java.util.Iterator; - import java.util.LinkedHashMap; + import java.util.HashSet; + import java.util.Iterator; + import java.util.LinkedHashMap; @@ -38,7 +40,6 @@ import org.apache.maven.artifact.Artifact; - import org.apache.maven.artifact.factory.ArtifactFactory; - import org.apache.maven.artifact.metadata.ArtifactMetadataSource; - import org.apache.maven.artifact.repository.ArtifactRepository; --import org.apache.maven.artifact.resolver.ArtifactCollector; - import org.apache.maven.artifact.resolver.ArtifactNotFoundException; - import org.apache.maven.artifact.resolver.ArtifactResolutionException; - import org.apache.maven.artifact.resolver.ArtifactResolver; + import org.apache.maven.artifact.factory.ArtifactFactory; + import org.apache.maven.artifact.metadata.ArtifactMetadataSource; + import org.apache.maven.artifact.repository.ArtifactRepository; +-import org.apache.maven.artifact.resolver.ArtifactCollector; + import org.apache.maven.artifact.resolver.ArtifactNotFoundException; + import org.apache.maven.artifact.resolver.ArtifactResolutionException; + import org.apache.maven.artifact.resolver.ArtifactResolver; @@ -49,13 +50,14 @@ import org.apache.maven.plugins.annotations.LifecyclePhase; - import org.apache.maven.plugins.annotations.Mojo; - import org.apache.maven.plugins.annotations.Parameter; - import org.apache.maven.plugins.annotations.ResolutionScope; + import org.apache.maven.plugins.annotations.Mojo; + import org.apache.maven.plugins.annotations.Parameter; + import org.apache.maven.plugins.annotations.ResolutionScope; +import org.apache.maven.project.DefaultProjectBuildingRequest; - import org.apache.maven.project.MavenProject; - import org.apache.maven.project.MavenProjectBuilder; - import org.apache.maven.project.ProjectBuildingException; + import org.apache.maven.project.MavenProject; + import org.apache.maven.project.MavenProjectBuilder; + import org.apache.maven.project.ProjectBuildingException; +import org.apache.maven.project.ProjectBuildingRequest; - import org.apache.maven.project.artifact.InvalidDependencyVersionException; --import org.apache.maven.shared.dependency.tree.DependencyNode; --import org.apache.maven.shared.dependency.tree.DependencyTreeBuilder; --import org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException; + import org.apache.maven.project.artifact.InvalidDependencyVersionException; +-import org.apache.maven.shared.dependency.tree.DependencyNode; +-import org.apache.maven.shared.dependency.tree.DependencyTreeBuilder; +-import org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException; +import org.apache.maven.shared.dependency.graph.DependencyGraphBuilderException; +import org.apache.maven.shared.dependency.graph.DependencyNode; - import org.codehaus.plexus.util.FileUtils; - - import aQute.bnd.osgi.Analyzer; + import org.codehaus.plexus.util.FileUtils; + + import aQute.bnd.osgi.Analyzer; @@ -92,24 +94,18 @@ public class BundleAllPlugin extends ManifestPlugin - */ - @Parameter( property = "wrapImportPackage", defaultValue = "*" ) - private String wrapImportPackage; -- - @Component - private ArtifactFactory m_factory; - - @Component - private ArtifactMetadataSource m_artifactMetadataSource; - -- @Component -- private ArtifactCollector m_collector; -- - /** - * Artifact resolver, needed to download jars. - */ - @Component - private ArtifactResolver m_artifactResolver; - -- @Component -- private DependencyTreeBuilder m_dependencyTreeBuilder; - - @Component - private MavenProjectBuilder m_mavenProjectBuilder; + */ + @Parameter( property = "wrapImportPackage", defaultValue = "*" ) + private String wrapImportPackage; +- + @Component + private ArtifactFactory m_factory; + + @Component + private ArtifactMetadataSource m_artifactMetadataSource; + +- @Component +- private ArtifactCollector m_collector; +- + /** + * Artifact resolver, needed to download jars. + */ + @Component + private ArtifactResolver m_artifactResolver; + +- @Component +- private DependencyTreeBuilder m_dependencyTreeBuilder; + + @Component + private MavenProjectBuilder m_mavenProjectBuilder; @@ -180,17 +176,19 @@ public class BundleAllPlugin extends ManifestPlugin - - try - { -- dependencyTree = m_dependencyTreeBuilder.buildDependencyTree( project, localRepository, m_factory, -- m_artifactMetadataSource, null, m_collector ); + + try + { +- dependencyTree = m_dependencyTreeBuilder.buildDependencyTree( project, localRepository, m_factory, +- m_artifactMetadataSource, null, m_collector ); + ProjectBuildingRequest request = new DefaultProjectBuildingRequest(); + request.setProject(getProject()); + request.setRepositorySession(session.getRepositorySession()); + dependencyTree = m_dependencyGraphBuilder.buildDependencyGraph(request, null); - } -- catch ( DependencyTreeBuilderException e ) + } +- catch ( DependencyTreeBuilderException e ) + catch ( DependencyGraphBuilderException e ) - { - throw new MojoExecutionException( "Unable to build dependency tree", e ); - } - - BundleInfo bundleInfo = new BundleInfo(); - -- if ( !dependencyTree.hasChildren() ) + { + throw new MojoExecutionException( "Unable to build dependency tree", e ); + } + + BundleInfo bundleInfo = new BundleInfo(); + +- if ( !dependencyTree.hasChildren() ) + if ( dependencyTree.getChildren().isEmpty()) - { - /* no need to traverse the tree */ - return bundleRoot( project, bundleInfo ); + { + /* no need to traverse the tree */ + return bundleRoot( project, bundleInfo ); @@ -198,20 +196,27 @@ public class BundleAllPlugin extends ManifestPlugin - - getLog().debug( "Will bundle the following dependency tree" + LS + dependencyTree ); - -- for ( Iterator it = dependencyTree.inverseIterator(); it.hasNext(); ) + + getLog().debug( "Will bundle the following dependency tree" + LS + dependencyTree ); + +- for ( Iterator it = dependencyTree.inverseIterator(); it.hasNext(); ) + Deque stack = new ArrayDeque(); + stack.push(dependencyTree); + Set visited = new HashSet(); + while (!stack.isEmpty()) - { -- DependencyNode node = ( DependencyNode ) it.next(); -- if ( !it.hasNext() ) + { +- DependencyNode node = ( DependencyNode ) it.next(); +- if ( !it.hasNext() ) + DependencyNode node = stack.pop(); + if (visited.contains(node)) - { -- /* this is the root, current project */ -- break; + { +- /* this is the root, current project */ +- break; + continue; - } -- -- if ( node.getState() != DependencyNode.INCLUDED ) + } +- +- if ( node.getState() != DependencyNode.INCLUDED ) + visited.add(node); + if (node.getChildren() != null) - { -- continue; + { +- continue; + stack.addAll(node.getChildren()); - } - + } + + //if ( node.getState() != DependencyNode.INCLUDED ) + //{ + // continue; + //} + - if ( Artifact.SCOPE_SYSTEM.equals( node.getArtifact().getScope() ) ) - { - getLog().debug( "Ignoring system scoped artifact " + node.getArtifact() ); + if ( Artifact.SCOPE_SYSTEM.equals( node.getArtifact().getScope() ) ) + { + getLog().debug( "Ignoring system scoped artifact " + node.getArtifact() ); @@ -235,12 +240,11 @@ public class BundleAllPlugin extends ManifestPlugin - - node.getArtifact().setFile( artifact.getFile() ); - -- int nodeDepth = node.getDepth(); -- if ( nodeDepth > maxDepth ) + + node.getArtifact().setFile( artifact.getFile() ); + +- int nodeDepth = node.getDepth(); +- if ( nodeDepth > maxDepth ) + if ( stack.size() > maxDepth ) - { - /* node is deeper than we want */ - getLog().debug( -- "Ignoring " + node.getArtifact() + ", depth is " + nodeDepth + ", bigger than " + maxDepth ); + { + /* node is deeper than we want */ + getLog().debug( +- "Ignoring " + node.getArtifact() + ", depth is " + nodeDepth + ", bigger than " + maxDepth ); + "Ignoring " + node.getArtifact() + ", depth is " + stack.size() + ", bigger than " + maxDepth ); - continue; - } - + continue; + } + diff --git a/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java b/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java -index 1dcf1c1..3e4384e 100644 +index 395340d..987a55c 100644 --- a/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java +++ b/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java -@@ -72,15 +72,15 @@ import org.apache.maven.plugins.annotations.LifecyclePhase; - import org.apache.maven.plugins.annotations.Mojo; - import org.apache.maven.plugins.annotations.Parameter; - import org.apache.maven.plugins.annotations.ResolutionScope; +@@ -73,12 +73,15 @@ import org.apache.maven.plugins.annotations.LifecyclePhase; + import org.apache.maven.plugins.annotations.Mojo; + import org.apache.maven.plugins.annotations.Parameter; + import org.apache.maven.plugins.annotations.ResolutionScope; +import org.apache.maven.project.DefaultProjectBuildingRequest; - import org.apache.maven.project.MavenProject; - import org.apache.maven.project.MavenProjectBuilder; - import org.apache.maven.project.MavenProjectHelper; - import org.apache.maven.project.ProjectBuildingException; + import org.apache.maven.project.MavenProject; + import org.apache.maven.project.MavenProjectBuilder; + import org.apache.maven.project.MavenProjectHelper; + import org.apache.maven.project.ProjectBuildingException; +-import org.apache.maven.shared.dependency.tree.DependencyTreeBuilder; +-import org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException; +import org.apache.maven.project.ProjectBuildingRequest; - import org.apache.maven.shared.dependency.graph.DependencyGraphBuilder; - import org.apache.maven.shared.dependency.graph.DependencyGraphBuilderException; - import org.apache.maven.shared.dependency.graph.DependencyNode; --import org.apache.maven.shared.dependency.tree.DependencyTreeBuilder; --import org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException; - import org.apache.maven.shared.osgi.DefaultMaven2OsgiConverter; - import org.apache.maven.shared.osgi.Maven2OsgiConverter; - import org.codehaus.plexus.archiver.UnArchiver; -@@ -225,9 +225,6 @@ public class BundlePlugin extends AbstractMojo - @Component - protected MavenProjectBuilder mavenProjectBuilder; - -- @Component -- private DependencyTreeBuilder dependencyTreeBuilder; -- - /** - * The dependency graph builder to use. - */ -@@ -347,7 +344,10 @@ public class BundlePlugin extends AbstractMojo - DependencyNode dependencyGraph; - try - { -- dependencyGraph = m_dependencyGraphBuilder.buildDependencyGraph( mavenProject, null ); -+ ProjectBuildingRequest request = new DefaultProjectBuildingRequest(); -+ request.setProject(mavenProject); -+ request.setRepositorySession(session.getRepositorySession()); -+ dependencyGraph = m_dependencyGraphBuilder.buildDependencyGraph( request, null ); - } - catch ( DependencyGraphBuilderException e ) - { -@@ -758,7 +758,7 @@ public class BundlePlugin extends AbstractMojo - // We need to find the direct dependencies that have been included in the uber JAR so that we can modify the - // POM accordingly. - private void createDependencyReducedPom( Set artifactsToRemove ) -- throws IOException, DependencyTreeBuilderException, ProjectBuildingException -+ throws IOException, DependencyGraphBuilderException, ProjectBuildingException - { - Model model = project.getOriginalModel(); - List dependencies = new ArrayList(); -@@ -901,24 +901,26 @@ public class BundlePlugin extends AbstractMojo - } - - public boolean updateExcludesInDeps( MavenProject project, List dependencies, List transitiveDeps ) -- throws DependencyTreeBuilderException -+ throws DependencyGraphBuilderException - { -- org.apache.maven.shared.dependency.tree.DependencyNode node = dependencyTreeBuilder.buildDependencyTree(project, localRepository, artifactFactory, -- artifactMetadataSource, null, -- artifactCollector); ++import org.apache.maven.shared.dependency.graph.DependencyGraphBuilder; ++import org.apache.maven.shared.dependency.graph.DependencyGraphBuilderException; ++import org.apache.maven.shared.dependency.graph.DependencyNode; + import org.apache.maven.shared.osgi.DefaultMaven2OsgiConverter; + import org.apache.maven.shared.osgi.Maven2OsgiConverter; + import org.codehaus.plexus.archiver.UnArchiver; +@@ -209,6 +212,9 @@ public class BundlePlugin extends AbstractMojo + @Component + private ArtifactHandlerManager m_artifactHandlerManager; + ++ @Component ++ protected DependencyGraphBuilder m_dependencyGraphBuilder; ++ + /* The current Maven session. */ + @Parameter( defaultValue = "${session}", readonly = true ) + protected MavenSession session; +@@ -221,7 +227,7 @@ public class BundlePlugin extends AbstractMojo + protected MavenProjectBuilder mavenProjectBuilder; + + @Component +- private DependencyTreeBuilder dependencyTreeBuilder; ++ private DependencyGraphBuilder dependencyGraphBuilder; + + @Component + private ArtifactMetadataSource artifactMetadataSource; +@@ -735,7 +741,7 @@ public class BundlePlugin extends AbstractMojo + // We need to find the direct dependencies that have been included in the uber JAR so that we can modify the + // POM accordingly. + private void createDependencyReducedPom( Set artifactsToRemove ) +- throws IOException, ProjectBuildingException, DependencyTreeBuilderException { ++ throws IOException, ProjectBuildingException, DependencyGraphBuilderException { + Model model = project.getOriginalModel(); + List dependencies = new ArrayList(); + +@@ -873,20 +879,22 @@ public class BundlePlugin extends AbstractMojo + } + + public boolean updateExcludesInDeps( MavenProject project, List dependencies, List transitiveDeps ) +- throws DependencyTreeBuilderException ++ throws DependencyGraphBuilderException + { +- org.apache.maven.shared.dependency.tree.DependencyNode node = dependencyTreeBuilder.buildDependencyTree(project, localRepository, artifactFactory, +- artifactMetadataSource, null, +- artifactCollector); + ProjectBuildingRequest request = new DefaultProjectBuildingRequest(); + request.setProject(project); + request.setRepositorySession(session.getRepositorySession()); + DependencyNode node = dependencyGraphBuilder.buildDependencyGraph(request, null); - boolean modified = false; - Iterator it = node.getChildren().listIterator(); - while ( it.hasNext() ) - { -- org.apache.maven.shared.dependency.tree.DependencyNode n2 = (org.apache.maven.shared.dependency.tree.DependencyNode) it.next(); -+ DependencyNode n2 = (DependencyNode) it.next(); - Iterator it2 = n2.getChildren().listIterator(); - while ( it2.hasNext() ) - { -- org.apache.maven.shared.dependency.tree.DependencyNode n3 = (org.apache.maven.shared.dependency.tree.DependencyNode) it2.next(); -+ DependencyNode n3 = (DependencyNode) it2.next(); - //anything two levels deep that is marked "included" - //is stuff that was excluded by the original poms, make sure it - //remains excluded IF promoting transitives. -- if ( n3.getState() == org.apache.maven.shared.dependency.tree.DependencyNode.INCLUDED ) -+ //if ( n3.getState() == org.apache.maven.shared.dependency.tree.DependencyNode.INCLUDED ) + boolean modified = false; +- for (org.apache.maven.shared.dependency.tree.DependencyNode n2 : node.getChildren()) ++ for (org.apache.maven.shared.dependency.graph.DependencyNode n2 : node.getChildren()) + { +- for (org.apache.maven.shared.dependency.tree.DependencyNode n3 : n2.getChildren()) ++ for (org.apache.maven.shared.dependency.graph.DependencyNode n3 : n2.getChildren()) + { + //anything two levels deep that is marked "included" + //is stuff that was excluded by the original poms, make sure it + //remains excluded IF promoting transitives. +- if (n3.getState() == org.apache.maven.shared.dependency.tree.DependencyNode.INCLUDED) ++ //if (n3.getState() == org.apache.maven.shared.dependency.tree.DependencyNode.INCLUDED) + if (true) - { - //check if it really isn't in the list of original dependencies. Maven - //prior to 2.0.8 may grab versions from transients instead of + { + //check if it really isn't in the list of original dependencies. Maven + //prior to 2.0.8 may grab versions from transients instead of -- 2.14.3 diff --git a/0002-Fix-for-new-maven-archiver.patch b/0002-Fix-for-new-maven-archiver.patch index 5fca0de..a6ab6a3 100644 --- a/0002-Fix-for-new-maven-archiver.patch +++ b/0002-Fix-for-new-maven-archiver.patch @@ -1,25 +1,25 @@ -From 17a505c7c7924540f9636e3cd2700cc25a59447e Mon Sep 17 00:00:00 2001 -From: Mat Booth -Date: Thu, 14 Apr 2016 17:00:23 +0100 -Subject: [PATCH 2/4] Fix for new maven archiver - ---- - src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java b/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java -index 3e4384e..a42d6ef 100644 ---- a/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java -+++ b/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java -@@ -1101,7 +1101,7 @@ public class BundlePlugin extends AbstractMojo +From 17a505c7c7924540f9636e3cd2700cc25a59447e Mon Sep 17 00:00:00 2001 +From: Mat Booth +Date: Thu, 14 Apr 2016 17:00:23 +0100 +Subject: [PATCH 2/4] Fix for new maven archiver + +--- + src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java b/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java +index 3e4384e..a42d6ef 100644 +--- a/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java ++++ b/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java +@@ -1104,7 +1104,7 @@ public class BundlePlugin extends AbstractMojo * Grab customized manifest entries from the maven-jar-plugin configuration */ MavenArchiveConfiguration archiveConfig = JarPluginConfiguration.getArchiveConfiguration( currentProject ); - String mavenManifestText = new MavenArchiver().getManifest( currentProject, archiveConfig ).toString(); -+ String mavenManifestText = new MavenArchiver().getManifest( m_mavenSession, currentProject, archiveConfig ).toString(); ++ String mavenManifestText = new MavenArchiver().getManifest( m_mavenSession, currentProject, archiveConfig ).toString(); addMavenDescriptor = addMavenDescriptor && archiveConfig.isAddMavenDescriptor(); Manifest mavenManifest = new Manifest(); --- -2.14.3 - +-- +2.14.3 + diff --git a/0003-Port-to-plexus-utils-3.0.24.patch b/0003-Port-to-plexus-utils-3.0.24.patch index 5600c14..1573530 100644 --- a/0003-Port-to-plexus-utils-3.0.24.patch +++ b/0003-Port-to-plexus-utils-3.0.24.patch @@ -1,46 +1,46 @@ -From 5e514316b5cfbe769b21dc089e2631a9c302dd19 Mon Sep 17 00:00:00 2001 -From: Mikolaj Izdebski -Date: Thu, 12 May 2016 09:24:36 +0200 -Subject: [PATCH 3/4] Port to plexus-utils 3.0.24 - ---- - pom.xml | 2 +- - src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java | 9 ++++++++- - 2 files changed, 9 insertions(+), 2 deletions(-) - -diff --git a/pom.xml b/pom.xml -index 46b2ba6..144f5ad 100644 ---- a/pom.xml -+++ b/pom.xml -@@ -194,7 +194,7 @@ +From 5e514316b5cfbe769b21dc089e2631a9c302dd19 Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Thu, 12 May 2016 09:24:36 +0200 +Subject: [PATCH 3/4] Port to plexus-utils 3.0.24 + +--- + pom.xml | 2 +- + src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java | 9 ++++++++- + 2 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/pom.xml b/pom.xml +index 46b2ba6..144f5ad 100644 +--- a/pom.xml ++++ b/pom.xml +@@ -197,7 +197,7 @@ org.codehaus.plexus plexus-utils - 3.0.10 -+ 3.0.24 ++ 3.0.24 org.sonatype.plexus -diff --git a/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java b/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java -index a42d6ef..c858b6b 100644 ---- a/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java -+++ b/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java -@@ -1806,7 +1806,14 @@ public class BundlePlugin extends AbstractMojo +diff --git a/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java b/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java +index a42d6ef..c858b6b 100644 +--- a/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java ++++ b/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java +@@ -1806,7 +1806,14 @@ public class BundlePlugin extends AbstractMojo File filterFile = new File( i.next() ); if ( filterFile.isFile() ) { - properties.putAll( PropertyUtils.loadProperties( filterFile ) ); -+ try -+ { -+ properties.putAll( PropertyUtils.loadProperties( filterFile ) ); -+ } -+ catch ( IOException exc ) -+ { -+ // Ignore -+ } ++ try ++ { ++ properties.putAll( PropertyUtils.loadProperties( filterFile ) ); ++ } ++ catch ( IOException exc ) ++ { ++ // Ignore ++ } } } --- -2.14.3 - +-- +2.14.3 + diff --git a/0004-Use-Maven-3-APIs.patch b/0004-Use-Maven-3-APIs.patch index cb1d30f..50d8d62 100644 --- a/0004-Use-Maven-3-APIs.patch +++ b/0004-Use-Maven-3-APIs.patch @@ -9,69 +9,50 @@ Subject: [PATCH 4/4] Use Maven 3 APIs 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml -index 144f5ad..cf3d7dc 100644 +index b1fc107..5fc0a36 100644 --- a/pom.xml +++ b/pom.xml -@@ -179,7 +179,17 @@ - - org.apache.maven - maven-core -- 2.2.0 -+ 3.3.9 -+ -+ -+ org.apache.maven -+ maven-compat -+ 3.3.9 -+ -+ -+ org.apache.maven.reporting -+ maven-reporting-impl -+ 2.4 - - - org.apache.maven -@@ -223,11 +233,6 @@ - 1.1 - test - -- -- org.jdom -- jdom -- 1.1 -- - - - +@@ -252,11 +252,6 @@ + 1.1.0 + test + +- +- org.jdom +- jdom +- 1.1 +- + + junit + junit diff --git a/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java b/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java -index c858b6b..5023569 100644 +index 987a55c..05e77b0 100644 --- a/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java +++ b/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java -@@ -46,7 +46,6 @@ import java.util.TreeMap; - import java.util.jar.Attributes; - import java.util.jar.Manifest; - --import org.apache.felix.bundleplugin.pom.PomWriter; - import org.apache.maven.archiver.ManifestSection; - import org.apache.maven.archiver.MavenArchiveConfiguration; - import org.apache.maven.archiver.MavenArchiver; -@@ -63,6 +62,7 @@ import org.apache.maven.model.Exclusion; - import org.apache.maven.model.License; - import org.apache.maven.model.Model; - import org.apache.maven.model.Resource; +@@ -47,7 +47,6 @@ import java.util.TreeMap; + import java.util.jar.Attributes; + import java.util.jar.Manifest; + +-import org.apache.felix.bundleplugin.pom.PomWriter; + import org.apache.maven.archiver.ManifestSection; + import org.apache.maven.archiver.MavenArchiveConfiguration; + import org.apache.maven.archiver.MavenArchiver; +@@ -64,6 +63,7 @@ import org.apache.maven.model.Exclusion; + import org.apache.maven.model.License; + import org.apache.maven.model.Model; + import org.apache.maven.model.Resource; +import org.apache.maven.model.io.xpp3.MavenXpp3Writer; - import org.apache.maven.plugin.AbstractMojo; - import org.apache.maven.plugin.MojoExecutionException; - import org.apache.maven.plugin.MojoFailureException; -@@ -864,7 +864,7 @@ public class BundlePlugin extends AbstractMojo - - try - { -- PomWriter.write( w, model, true ); + import org.apache.maven.plugin.AbstractMojo; + import org.apache.maven.plugin.MojoExecutionException; + import org.apache.maven.plugin.MojoFailureException; +@@ -842,7 +842,7 @@ public class BundlePlugin extends AbstractMojo + + try + { +- PomWriter.write( w, model, true ); + new MavenXpp3Writer().write( w, model ); - } - finally - { + } + finally + { -- 2.14.3 diff --git a/maven-plugin-bundle.spec b/maven-plugin-bundle.spec index 654bdb5..b90fc60 100644 --- a/maven-plugin-bundle.spec +++ b/maven-plugin-bundle.spec @@ -1,14 +1,12 @@ -%global site_name maven-bundle-plugin - Name: maven-plugin-bundle -Version: 3.5.0 -Release: 3%{?dist} +Version: 4.2.0 +Release: 1%{?dist} Summary: Maven Bundle Plugin License: ASL 2.0 URL: http://felix.apache.org BuildArch: noarch -Source0: http://repo2.maven.org/maven2/org/apache/felix/{%site_name}/%{version}/%{site_name}-%{version}-source-release.tar.gz +Source0: http://repo2.maven.org/maven2/org/apache/felix/maven-bundle-plugin/%{version}/maven-bundle-plugin-%{version}-source-release.tar.gz # Needs polishing to be sent upstream Patch0: 0001-Port-to-current-maven-dependency-tree.patch @@ -45,7 +43,7 @@ Summary: Javadoc for %{name} API documentation for %{name}. %prep -%setup -q -n %{site_name}-%{version} +%setup -q -n maven-bundle-plugin-%{version} %patch0 -p1 %patch1 -p1 @@ -71,7 +69,6 @@ rm -rf src/main/java/org/apache/felix/obrplugin/ rm -f src/main/java/org/apache/felix/bundleplugin/baseline/BaselineReport.java %pom_remove_dep :doxia-sink-api %pom_remove_dep :doxia-site-renderer -%pom_remove_dep :maven-reporting-impl %build # Tests depend on bundled JARs @@ -87,6 +84,9 @@ rm -f src/main/java/org/apache/felix/bundleplugin/baseline/BaselineReport.java %doc LICENSE NOTICE %changelog +* Tue Jun 04 2019 Marian Koncek - 4.2.0-1 +- Update to upstream version 4.2.0 + * Fri May 24 2019 Mikolaj Izdebski - 3.5.0-3 - Mass rebuild for javapackages-tools 201901 diff --git a/sources b/sources index 96f1dc3..416ede3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (maven-bundle-plugin-3.5.0-source-release.tar.gz) = 81f81d61c7c8739788caa22ec615a3bfb6b753e81d8cb05cfaf3bcc5d936877caea5d75c3ac911fed75e0b3bf9822b258ac5f1d5564f88d569bf5102313841f0 +SHA512 (maven-bundle-plugin-4.2.0-source-release.tar.gz) = 6b8c2dda06dbb6ba496862c8f94e6c2adbccf5a5d438fe1efbd7ff456c529f7cb4ac17e0d6cc022b3d183d06e4006fa3fba0166c4370fd3c2b1e9e53510f6618 From 644b324b7a725871023cc5e0aebadb5ac841db2b Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Thu, 5 Sep 2019 09:08:22 +0200 Subject: [PATCH 4/9] Update to upstream version 4.2.1 --- .gitignore | 1 + maven-plugin-bundle.spec | 8 +++++++- sources | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 5ac4c75..f0b63e9 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ maven-bundle-plugin-2.0.0-project.tar.gz /maven-bundle-plugin-3.4.0-source-release.tar.gz /maven-bundle-plugin-3.5.0-source-release.tar.gz /maven-bundle-plugin-4.2.0-source-release.tar.gz +/maven-bundle-plugin-4.2.1-source-release.tar.gz diff --git a/maven-plugin-bundle.spec b/maven-plugin-bundle.spec index b90fc60..831af9e 100644 --- a/maven-plugin-bundle.spec +++ b/maven-plugin-bundle.spec @@ -1,5 +1,5 @@ Name: maven-plugin-bundle -Version: 4.2.0 +Version: 4.2.1 Release: 1%{?dist} Summary: Maven Bundle Plugin License: ASL 2.0 @@ -45,6 +45,9 @@ API documentation for %{name}. %prep %setup -q -n maven-bundle-plugin-%{version} +find -name 'pom.xml' -exec sed -i 's/\r//' {} \; +find -name '*.java' -exec sed -i 's/\r//' {} \; + %patch0 -p1 %patch1 -p1 %patch2 -p1 @@ -84,6 +87,9 @@ rm -f src/main/java/org/apache/felix/bundleplugin/baseline/BaselineReport.java %doc LICENSE NOTICE %changelog +* Mon Aug 19 2019 Marian Koncek - 4.2.1-1 +- Update to upstream version 4.2.1 + * Tue Jun 04 2019 Marian Koncek - 4.2.0-1 - Update to upstream version 4.2.0 diff --git a/sources b/sources index 416ede3..eda8dad 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (maven-bundle-plugin-4.2.0-source-release.tar.gz) = 6b8c2dda06dbb6ba496862c8f94e6c2adbccf5a5d438fe1efbd7ff456c529f7cb4ac17e0d6cc022b3d183d06e4006fa3fba0166c4370fd3c2b1e9e53510f6618 +SHA512 (maven-bundle-plugin-4.2.1-source-release.tar.gz) = c1d9ec95c6b96d47e4e63be6652356f0f3b7a48f351bcc72f4b844d1e95ec7b52c1583d7d425c1e8466e87619a1f50592d6a763e8dea146c64608f94192994b4 From be90356ace25f1cd8f2279767e0a387188699ebe Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Tue, 5 Nov 2019 17:29:28 +0100 Subject: [PATCH 5/9] Mass rebuild for javapackages-tools 201902 --- maven-plugin-bundle.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/maven-plugin-bundle.spec b/maven-plugin-bundle.spec index 831af9e..f3787ac 100644 --- a/maven-plugin-bundle.spec +++ b/maven-plugin-bundle.spec @@ -1,6 +1,6 @@ Name: maven-plugin-bundle Version: 4.2.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Maven Bundle Plugin License: ASL 2.0 URL: http://felix.apache.org @@ -87,6 +87,9 @@ rm -f src/main/java/org/apache/felix/bundleplugin/baseline/BaselineReport.java %doc LICENSE NOTICE %changelog +* Tue Nov 05 2019 Mikolaj Izdebski - 4.2.1-2 +- Mass rebuild for javapackages-tools 201902 + * Mon Aug 19 2019 Marian Koncek - 4.2.1-1 - Update to upstream version 4.2.1 From 2f4ac78674112da1b18351df629fb6fcb4703718 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Mon, 27 Apr 2020 13:17:14 +0200 Subject: [PATCH 6/9] Remove unneeded dependency on maven-reporting-api --- maven-plugin-bundle.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/maven-plugin-bundle.spec b/maven-plugin-bundle.spec index f3787ac..119032d 100644 --- a/maven-plugin-bundle.spec +++ b/maven-plugin-bundle.spec @@ -72,6 +72,7 @@ rm -rf src/main/java/org/apache/felix/obrplugin/ rm -f src/main/java/org/apache/felix/bundleplugin/baseline/BaselineReport.java %pom_remove_dep :doxia-sink-api %pom_remove_dep :doxia-site-renderer +%pom_remove_dep :maven-reporting-api %build # Tests depend on bundled JARs From 3e392b6afa667300f7117abf78c1663f8113ae8b Mon Sep 17 00:00:00 2001 From: Marian Koncek Date: Wed, 26 Aug 2020 17:21:14 +0200 Subject: [PATCH 7/9] Update to upstream version 5.1.1 --- .gitignore | 1 + ...ort-to-current-maven-dependency-tree.patch | 248 ------------------ 0002-Fix-for-new-maven-archiver.patch | 25 -- 0003-Port-to-plexus-utils-3.0.24.patch | 46 ---- 0004-Use-Maven-3-APIs.patch | 58 ---- maven-plugin-bundle.spec | 42 +-- sources | 2 +- 7 files changed, 14 insertions(+), 408 deletions(-) delete mode 100644 0001-Port-to-current-maven-dependency-tree.patch delete mode 100644 0002-Fix-for-new-maven-archiver.patch delete mode 100644 0003-Port-to-plexus-utils-3.0.24.patch delete mode 100644 0004-Use-Maven-3-APIs.patch diff --git a/.gitignore b/.gitignore index f0b63e9..da0bd64 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ maven-bundle-plugin-2.0.0-project.tar.gz /maven-bundle-plugin-3.5.0-source-release.tar.gz /maven-bundle-plugin-4.2.0-source-release.tar.gz /maven-bundle-plugin-4.2.1-source-release.tar.gz +/maven-bundle-plugin-5.1.1-source-release.tar.gz diff --git a/0001-Port-to-current-maven-dependency-tree.patch b/0001-Port-to-current-maven-dependency-tree.patch deleted file mode 100644 index 77db78f..0000000 --- a/0001-Port-to-current-maven-dependency-tree.patch +++ /dev/null @@ -1,248 +0,0 @@ -From ac9f85cd5fdab1d51defa363b31235c45560c7f6 Mon Sep 17 00:00:00 2001 -From: Michael Simacek -Date: Fri, 12 Feb 2016 09:45:20 +0100 -Subject: [PATCH 1/4] Port to current maven-dependency-tree - ---- - pom.xml | 2 +- - .../apache/felix/bundleplugin/BundleAllPlugin.java | 54 ++++++++++++---------- - .../apache/felix/bundleplugin/BundlePlugin.java | 30 ++++++------ - 3 files changed, 46 insertions(+), 40 deletions(-) - -diff --git a/pom.xml b/pom.xml -index dfbf237..46b2ba6 100644 ---- a/pom.xml -+++ b/pom.xml -@@ -192,7 +192,7 @@ - - org.apache.maven.shared - maven-dependency-tree -- 2.1 -+ 3.0 - - - org.codehaus.plexus -diff --git a/src/main/java/org/apache/felix/bundleplugin/BundleAllPlugin.java b/src/main/java/org/apache/felix/bundleplugin/BundleAllPlugin.java -index f3b5509..6591923 100644 ---- a/src/main/java/org/apache/felix/bundleplugin/BundleAllPlugin.java -+++ b/src/main/java/org/apache/felix/bundleplugin/BundleAllPlugin.java -@@ -21,8 +21,10 @@ package org.apache.felix.bundleplugin; - - import java.io.File; - import java.io.FilenameFilter; -+import java.util.ArrayDeque; - import java.util.Arrays; - import java.util.Collection; -+import java.util.Deque; - import java.util.HashSet; - import java.util.Iterator; - import java.util.LinkedHashMap; -@@ -38,7 +40,6 @@ import org.apache.maven.artifact.Artifact; - import org.apache.maven.artifact.factory.ArtifactFactory; - import org.apache.maven.artifact.metadata.ArtifactMetadataSource; - import org.apache.maven.artifact.repository.ArtifactRepository; --import org.apache.maven.artifact.resolver.ArtifactCollector; - import org.apache.maven.artifact.resolver.ArtifactNotFoundException; - import org.apache.maven.artifact.resolver.ArtifactResolutionException; - import org.apache.maven.artifact.resolver.ArtifactResolver; -@@ -49,13 +50,14 @@ import org.apache.maven.plugins.annotations.LifecyclePhase; - import org.apache.maven.plugins.annotations.Mojo; - import org.apache.maven.plugins.annotations.Parameter; - import org.apache.maven.plugins.annotations.ResolutionScope; -+import org.apache.maven.project.DefaultProjectBuildingRequest; - import org.apache.maven.project.MavenProject; - import org.apache.maven.project.MavenProjectBuilder; - import org.apache.maven.project.ProjectBuildingException; -+import org.apache.maven.project.ProjectBuildingRequest; - import org.apache.maven.project.artifact.InvalidDependencyVersionException; --import org.apache.maven.shared.dependency.tree.DependencyNode; --import org.apache.maven.shared.dependency.tree.DependencyTreeBuilder; --import org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException; -+import org.apache.maven.shared.dependency.graph.DependencyGraphBuilderException; -+import org.apache.maven.shared.dependency.graph.DependencyNode; - import org.codehaus.plexus.util.FileUtils; - - import aQute.bnd.osgi.Analyzer; -@@ -92,24 +94,18 @@ public class BundleAllPlugin extends ManifestPlugin - */ - @Parameter( property = "wrapImportPackage", defaultValue = "*" ) - private String wrapImportPackage; -- - @Component - private ArtifactFactory m_factory; - - @Component - private ArtifactMetadataSource m_artifactMetadataSource; - -- @Component -- private ArtifactCollector m_collector; -- - /** - * Artifact resolver, needed to download jars. - */ - @Component - private ArtifactResolver m_artifactResolver; - -- @Component -- private DependencyTreeBuilder m_dependencyTreeBuilder; - - @Component - private MavenProjectBuilder m_mavenProjectBuilder; -@@ -180,17 +176,19 @@ public class BundleAllPlugin extends ManifestPlugin - - try - { -- dependencyTree = m_dependencyTreeBuilder.buildDependencyTree( project, localRepository, m_factory, -- m_artifactMetadataSource, null, m_collector ); -+ ProjectBuildingRequest request = new DefaultProjectBuildingRequest(); -+ request.setProject(getProject()); -+ request.setRepositorySession(session.getRepositorySession()); -+ dependencyTree = m_dependencyGraphBuilder.buildDependencyGraph(request, null); - } -- catch ( DependencyTreeBuilderException e ) -+ catch ( DependencyGraphBuilderException e ) - { - throw new MojoExecutionException( "Unable to build dependency tree", e ); - } - - BundleInfo bundleInfo = new BundleInfo(); - -- if ( !dependencyTree.hasChildren() ) -+ if ( dependencyTree.getChildren().isEmpty()) - { - /* no need to traverse the tree */ - return bundleRoot( project, bundleInfo ); -@@ -198,20 +196,27 @@ public class BundleAllPlugin extends ManifestPlugin - - getLog().debug( "Will bundle the following dependency tree" + LS + dependencyTree ); - -- for ( Iterator it = dependencyTree.inverseIterator(); it.hasNext(); ) -+ Deque stack = new ArrayDeque(); -+ stack.push(dependencyTree); -+ Set visited = new HashSet(); -+ while (!stack.isEmpty()) - { -- DependencyNode node = ( DependencyNode ) it.next(); -- if ( !it.hasNext() ) -+ DependencyNode node = stack.pop(); -+ if (visited.contains(node)) - { -- /* this is the root, current project */ -- break; -+ continue; - } -- -- if ( node.getState() != DependencyNode.INCLUDED ) -+ visited.add(node); -+ if (node.getChildren() != null) - { -- continue; -+ stack.addAll(node.getChildren()); - } - -+ //if ( node.getState() != DependencyNode.INCLUDED ) -+ //{ -+ // continue; -+ //} -+ - if ( Artifact.SCOPE_SYSTEM.equals( node.getArtifact().getScope() ) ) - { - getLog().debug( "Ignoring system scoped artifact " + node.getArtifact() ); -@@ -235,12 +240,11 @@ public class BundleAllPlugin extends ManifestPlugin - - node.getArtifact().setFile( artifact.getFile() ); - -- int nodeDepth = node.getDepth(); -- if ( nodeDepth > maxDepth ) -+ if ( stack.size() > maxDepth ) - { - /* node is deeper than we want */ - getLog().debug( -- "Ignoring " + node.getArtifact() + ", depth is " + nodeDepth + ", bigger than " + maxDepth ); -+ "Ignoring " + node.getArtifact() + ", depth is " + stack.size() + ", bigger than " + maxDepth ); - continue; - } - -diff --git a/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java b/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java -index 395340d..987a55c 100644 ---- a/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java -+++ b/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java -@@ -73,12 +73,15 @@ import org.apache.maven.plugins.annotations.LifecyclePhase; - import org.apache.maven.plugins.annotations.Mojo; - import org.apache.maven.plugins.annotations.Parameter; - import org.apache.maven.plugins.annotations.ResolutionScope; -+import org.apache.maven.project.DefaultProjectBuildingRequest; - import org.apache.maven.project.MavenProject; - import org.apache.maven.project.MavenProjectBuilder; - import org.apache.maven.project.MavenProjectHelper; - import org.apache.maven.project.ProjectBuildingException; --import org.apache.maven.shared.dependency.tree.DependencyTreeBuilder; --import org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException; -+import org.apache.maven.project.ProjectBuildingRequest; -+import org.apache.maven.shared.dependency.graph.DependencyGraphBuilder; -+import org.apache.maven.shared.dependency.graph.DependencyGraphBuilderException; -+import org.apache.maven.shared.dependency.graph.DependencyNode; - import org.apache.maven.shared.osgi.DefaultMaven2OsgiConverter; - import org.apache.maven.shared.osgi.Maven2OsgiConverter; - import org.codehaus.plexus.archiver.UnArchiver; -@@ -209,6 +212,9 @@ public class BundlePlugin extends AbstractMojo - @Component - private ArtifactHandlerManager m_artifactHandlerManager; - -+ @Component -+ protected DependencyGraphBuilder m_dependencyGraphBuilder; -+ - /* The current Maven session. */ - @Parameter( defaultValue = "${session}", readonly = true ) - protected MavenSession session; -@@ -221,7 +227,7 @@ public class BundlePlugin extends AbstractMojo - protected MavenProjectBuilder mavenProjectBuilder; - - @Component -- private DependencyTreeBuilder dependencyTreeBuilder; -+ private DependencyGraphBuilder dependencyGraphBuilder; - - @Component - private ArtifactMetadataSource artifactMetadataSource; -@@ -735,7 +741,7 @@ public class BundlePlugin extends AbstractMojo - // We need to find the direct dependencies that have been included in the uber JAR so that we can modify the - // POM accordingly. - private void createDependencyReducedPom( Set artifactsToRemove ) -- throws IOException, ProjectBuildingException, DependencyTreeBuilderException { -+ throws IOException, ProjectBuildingException, DependencyGraphBuilderException { - Model model = project.getOriginalModel(); - List dependencies = new ArrayList(); - -@@ -873,20 +879,22 @@ public class BundlePlugin extends AbstractMojo - } - - public boolean updateExcludesInDeps( MavenProject project, List dependencies, List transitiveDeps ) -- throws DependencyTreeBuilderException -+ throws DependencyGraphBuilderException - { -- org.apache.maven.shared.dependency.tree.DependencyNode node = dependencyTreeBuilder.buildDependencyTree(project, localRepository, artifactFactory, -- artifactMetadataSource, null, -- artifactCollector); -+ ProjectBuildingRequest request = new DefaultProjectBuildingRequest(); -+ request.setProject(project); -+ request.setRepositorySession(session.getRepositorySession()); -+ DependencyNode node = dependencyGraphBuilder.buildDependencyGraph(request, null); - boolean modified = false; -- for (org.apache.maven.shared.dependency.tree.DependencyNode n2 : node.getChildren()) -+ for (org.apache.maven.shared.dependency.graph.DependencyNode n2 : node.getChildren()) - { -- for (org.apache.maven.shared.dependency.tree.DependencyNode n3 : n2.getChildren()) -+ for (org.apache.maven.shared.dependency.graph.DependencyNode n3 : n2.getChildren()) - { - //anything two levels deep that is marked "included" - //is stuff that was excluded by the original poms, make sure it - //remains excluded IF promoting transitives. -- if (n3.getState() == org.apache.maven.shared.dependency.tree.DependencyNode.INCLUDED) -+ //if (n3.getState() == org.apache.maven.shared.dependency.tree.DependencyNode.INCLUDED) -+ if (true) - { - //check if it really isn't in the list of original dependencies. Maven - //prior to 2.0.8 may grab versions from transients instead of --- -2.14.3 - diff --git a/0002-Fix-for-new-maven-archiver.patch b/0002-Fix-for-new-maven-archiver.patch deleted file mode 100644 index a6ab6a3..0000000 --- a/0002-Fix-for-new-maven-archiver.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 17a505c7c7924540f9636e3cd2700cc25a59447e Mon Sep 17 00:00:00 2001 -From: Mat Booth -Date: Thu, 14 Apr 2016 17:00:23 +0100 -Subject: [PATCH 2/4] Fix for new maven archiver - ---- - src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java b/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java -index 3e4384e..a42d6ef 100644 ---- a/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java -+++ b/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java -@@ -1104,7 +1104,7 @@ public class BundlePlugin extends AbstractMojo - * Grab customized manifest entries from the maven-jar-plugin configuration - */ - MavenArchiveConfiguration archiveConfig = JarPluginConfiguration.getArchiveConfiguration( currentProject ); -- String mavenManifestText = new MavenArchiver().getManifest( currentProject, archiveConfig ).toString(); -+ String mavenManifestText = new MavenArchiver().getManifest( m_mavenSession, currentProject, archiveConfig ).toString(); - addMavenDescriptor = addMavenDescriptor && archiveConfig.isAddMavenDescriptor(); - - Manifest mavenManifest = new Manifest(); --- -2.14.3 - diff --git a/0003-Port-to-plexus-utils-3.0.24.patch b/0003-Port-to-plexus-utils-3.0.24.patch deleted file mode 100644 index 1573530..0000000 --- a/0003-Port-to-plexus-utils-3.0.24.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 5e514316b5cfbe769b21dc089e2631a9c302dd19 Mon Sep 17 00:00:00 2001 -From: Mikolaj Izdebski -Date: Thu, 12 May 2016 09:24:36 +0200 -Subject: [PATCH 3/4] Port to plexus-utils 3.0.24 - ---- - pom.xml | 2 +- - src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java | 9 ++++++++- - 2 files changed, 9 insertions(+), 2 deletions(-) - -diff --git a/pom.xml b/pom.xml -index 46b2ba6..144f5ad 100644 ---- a/pom.xml -+++ b/pom.xml -@@ -197,7 +197,7 @@ - - org.codehaus.plexus - plexus-utils -- 3.0.10 -+ 3.0.24 - - - org.sonatype.plexus -diff --git a/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java b/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java -index a42d6ef..c858b6b 100644 ---- a/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java -+++ b/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java -@@ -1806,7 +1806,14 @@ public class BundlePlugin extends AbstractMojo - File filterFile = new File( i.next() ); - if ( filterFile.isFile() ) - { -- properties.putAll( PropertyUtils.loadProperties( filterFile ) ); -+ try -+ { -+ properties.putAll( PropertyUtils.loadProperties( filterFile ) ); -+ } -+ catch ( IOException exc ) -+ { -+ // Ignore -+ } - } - } - --- -2.14.3 - diff --git a/0004-Use-Maven-3-APIs.patch b/0004-Use-Maven-3-APIs.patch deleted file mode 100644 index 50d8d62..0000000 --- a/0004-Use-Maven-3-APIs.patch +++ /dev/null @@ -1,58 +0,0 @@ -From e0f3d1cddc9ce70d8290aafbdaa36e3aa56e5e9d Mon Sep 17 00:00:00 2001 -From: Mikolaj Izdebski -Date: Wed, 12 Oct 2016 23:43:00 +0200 -Subject: [PATCH 4/4] Use Maven 3 APIs - ---- - pom.xml | 17 +++++++++++------ - .../org/apache/felix/bundleplugin/BundlePlugin.java | 4 ++-- - 2 files changed, 13 insertions(+), 8 deletions(-) - -diff --git a/pom.xml b/pom.xml -index b1fc107..5fc0a36 100644 ---- a/pom.xml -+++ b/pom.xml -@@ -252,11 +252,6 @@ - 1.1.0 - test - -- -- org.jdom -- jdom -- 1.1 -- - - junit - junit -diff --git a/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java b/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java -index 987a55c..05e77b0 100644 ---- a/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java -+++ b/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java -@@ -47,7 +47,6 @@ import java.util.TreeMap; - import java.util.jar.Attributes; - import java.util.jar.Manifest; - --import org.apache.felix.bundleplugin.pom.PomWriter; - import org.apache.maven.archiver.ManifestSection; - import org.apache.maven.archiver.MavenArchiveConfiguration; - import org.apache.maven.archiver.MavenArchiver; -@@ -64,6 +63,7 @@ import org.apache.maven.model.Exclusion; - import org.apache.maven.model.License; - import org.apache.maven.model.Model; - import org.apache.maven.model.Resource; -+import org.apache.maven.model.io.xpp3.MavenXpp3Writer; - import org.apache.maven.plugin.AbstractMojo; - import org.apache.maven.plugin.MojoExecutionException; - import org.apache.maven.plugin.MojoFailureException; -@@ -842,7 +842,7 @@ public class BundlePlugin extends AbstractMojo - - try - { -- PomWriter.write( w, model, true ); -+ new MavenXpp3Writer().write( w, model ); - } - finally - { --- -2.14.3 - diff --git a/maven-plugin-bundle.spec b/maven-plugin-bundle.spec index 119032d..d373791 100644 --- a/maven-plugin-bundle.spec +++ b/maven-plugin-bundle.spec @@ -1,21 +1,12 @@ Name: maven-plugin-bundle -Version: 4.2.1 -Release: 2%{?dist} +Version: 5.1.1 +Release: 1%{?dist} Summary: Maven Bundle Plugin License: ASL 2.0 -URL: http://felix.apache.org +URL: https://felix.apache.org BuildArch: noarch -Source0: http://repo2.maven.org/maven2/org/apache/felix/maven-bundle-plugin/%{version}/maven-bundle-plugin-%{version}-source-release.tar.gz - -# Needs polishing to be sent upstream -Patch0: 0001-Port-to-current-maven-dependency-tree.patch -# New maven-archiver removed some deprecated methods we were using -Patch1: 0002-Fix-for-new-maven-archiver.patch -# Port to newer Plexus utils -Patch2: 0003-Port-to-plexus-utils-3.0.24.patch -# Port to newer Maven -Patch3: 0004-Use-Maven-3-APIs.patch +Source0: https://repo1.maven.org/maven2/org/apache/felix/maven-bundle-plugin/%{version}/maven-bundle-plugin-%{version}-source-release.tar.gz BuildRequires: maven-local BuildRequires: mvn(biz.aQute.bnd:biz.aQute.bndlib) @@ -28,7 +19,6 @@ BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin) BuildRequires: mvn(org.apache.maven.plugin-tools:maven-plugin-annotations) BuildRequires: mvn(org.apache.maven.shared:maven-dependency-tree) BuildRequires: mvn(org.codehaus.plexus:plexus-utils) -BuildRequires: mvn(org.osgi:osgi.core) BuildRequires: mvn(org.sonatype.plexus:plexus-build-api) %description @@ -45,24 +35,8 @@ API documentation for %{name}. %prep %setup -q -n maven-bundle-plugin-%{version} -find -name 'pom.xml' -exec sed -i 's/\r//' {} \; -find -name '*.java' -exec sed -i 's/\r//' {} \; - -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 - find -name '*.jar' -delete -%pom_change_dep :org.osgi.core :osgi.core - -# Bundled class from old maven-dependency-tree -rm -r src/main/java/org/apache/maven/shared/dependency - -# Bundled classes from old maven -rm -r src/main/java/org/apache/felix/bundleplugin/pom - # There is forked version of maven-osgi in # src/{main,test}/java/org/apache/maven @@ -74,6 +48,11 @@ rm -f src/main/java/org/apache/felix/bundleplugin/baseline/BaselineReport.java %pom_remove_dep :doxia-site-renderer %pom_remove_dep :maven-reporting-api +%pom_remove_dep :org.osgi.core +%pom_remove_dep :jdom + +%pom_remove_plugin :maven-invoker-plugin + %build # Tests depend on bundled JARs %mvn_build -f @@ -88,6 +67,9 @@ rm -f src/main/java/org/apache/felix/bundleplugin/baseline/BaselineReport.java %doc LICENSE NOTICE %changelog +* Wed Aug 26 2020 Marian Koncek - 5.1.1-1 +- Update to upstream version 5.1.1 + * Tue Nov 05 2019 Mikolaj Izdebski - 4.2.1-2 - Mass rebuild for javapackages-tools 201902 diff --git a/sources b/sources index eda8dad..fa11b66 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (maven-bundle-plugin-4.2.1-source-release.tar.gz) = c1d9ec95c6b96d47e4e63be6652356f0f3b7a48f351bcc72f4b844d1e95ec7b52c1583d7d425c1e8466e87619a1f50592d6a763e8dea146c64608f94192994b4 +SHA512 (maven-bundle-plugin-5.1.1-source-release.tar.gz) = 69fb74db85db435a9bb6c035ed1fe736e4e7bb2c7ad0f219000113052b83247cad3c165eaed45e12da2cdd4e522320ee5fcf55b86147f142f96e60a060598a59 From 71d9455e941c3f1be51796bc7d5dcf944cb4f1d3 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Fri, 16 Apr 2021 15:33:12 +0200 Subject: [PATCH 8/9] Conditionalize buildrequires in bootstrap mode --- maven-plugin-bundle.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maven-plugin-bundle.spec b/maven-plugin-bundle.spec index d373791..ce75a02 100644 --- a/maven-plugin-bundle.spec +++ b/maven-plugin-bundle.spec @@ -1,3 +1,5 @@ +%bcond_without bootstrap + Name: maven-plugin-bundle Version: 5.1.1 Release: 1%{?dist} @@ -9,6 +11,9 @@ BuildArch: noarch Source0: https://repo1.maven.org/maven2/org/apache/felix/maven-bundle-plugin/%{version}/maven-bundle-plugin-%{version}-source-release.tar.gz BuildRequires: maven-local +%if %{with bootstrap} +BuildRequires: javapackages-bootstrap +%else BuildRequires: mvn(biz.aQute.bnd:biz.aQute.bndlib) BuildRequires: mvn(org.apache.felix:felix-parent:pom:) BuildRequires: mvn(org.apache.felix:org.apache.felix.utils) @@ -20,6 +25,7 @@ BuildRequires: mvn(org.apache.maven.plugin-tools:maven-plugin-annotations) BuildRequires: mvn(org.apache.maven.shared:maven-dependency-tree) BuildRequires: mvn(org.codehaus.plexus:plexus-utils) BuildRequires: mvn(org.sonatype.plexus:plexus-build-api) +%endif %description Provides a maven plugin that supports creating an OSGi bundle From 6267e05cc79e33fc9bf872449553cbe77b09f231 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Thu, 13 May 2021 19:08:42 +0200 Subject: [PATCH 9/9] Turn off bootstrap mode by default --- maven-plugin-bundle.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maven-plugin-bundle.spec b/maven-plugin-bundle.spec index ce75a02..50f802d 100644 --- a/maven-plugin-bundle.spec +++ b/maven-plugin-bundle.spec @@ -1,4 +1,4 @@ -%bcond_without bootstrap +%bcond_with bootstrap Name: maven-plugin-bundle Version: 5.1.1