diff --git a/apache-maven-2.2.1-src.tar.gz b/apache-maven-2.2.1-src.tar.gz new file mode 100644 index 0000000..c40c212 Binary files /dev/null and b/apache-maven-2.2.1-src.tar.gz differ diff --git a/maven2-2.2.1-migrate-to-plexus-containers-container-default.patch b/maven2-2.2.1-migrate-to-plexus-containers-container-default.patch new file mode 100644 index 0000000..36897f4 --- /dev/null +++ b/maven2-2.2.1-migrate-to-plexus-containers-container-default.patch @@ -0,0 +1,81 @@ +From 7b57fd654710a1a21af22642eda12f8027289986 Mon Sep 17 00:00:00 2001 +From: Michal Srb +Date: Wed, 3 Jul 2013 10:04:03 +0200 +Subject: [PATCH] Migrate to plexus-containers-container-default + +--- + .../maven/profiles/DefaultProfileManager.java | 28 ++++++++++++++++++---- + 1 file changed, 23 insertions(+), 5 deletions(-) + +diff --git a/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java b/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java +index e62d5ed..b72d515 100644 +--- a/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java ++++ b/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java +@@ -26,8 +26,10 @@ import org.apache.maven.profiles.activation.ProfileActivator; + import org.apache.maven.settings.Settings; + import org.apache.maven.settings.SettingsUtils; + import org.codehaus.plexus.PlexusContainer; ++import org.codehaus.plexus.component.factory.ComponentInstantiationException; + import org.codehaus.plexus.component.repository.exception.ComponentLifecycleException; + import org.codehaus.plexus.component.repository.exception.ComponentLookupException; ++import org.codehaus.plexus.logging.Logger; + + import java.util.ArrayList; + import java.util.Iterator; +@@ -119,8 +121,12 @@ public class DefaultProfileManager + Profile existing = (Profile) profilesById.get( profileId ); + if ( existing != null ) + { +- container.getLogger().warn( "Overriding profile: \'" + profileId + "\' (source: " + existing.getSource() + +- ") with new instance from source: " + profile.getSource() ); ++ try { ++ container.lookup( Logger.class ).warn( "Overriding profile: \'" + profileId + "\' (source: " + existing.getSource() + ++ ") with new instance from source: " + profile.getSource() ); ++ } catch ( ComponentLookupException e ) { ++ throw new RuntimeException( e ); ++ } + } + + profilesById.put( profile.getId(), profile ); +@@ -140,7 +146,11 @@ public class DefaultProfileManager + { + if ( !activatedIds.contains( profileId ) ) + { +- container.getLogger().debug( "Profile with id: \'" + profileId + "\' has been explicitly activated." ); ++ try { ++ container.lookup( Logger.class ).debug( "Profile with id: \'" + profileId + "\' has been explicitly activated." ); ++ } catch ( ComponentLookupException e ) { ++ throw new RuntimeException( e ); ++ } + + activatedIds.add( profileId ); + } +@@ -166,7 +176,11 @@ public class DefaultProfileManager + { + if ( !deactivatedIds.contains( profileId ) ) + { +- container.getLogger().debug( "Profile with id: \'" + profileId + "\' has been explicitly deactivated." ); ++ try { ++ container.lookup( Logger.class ).debug( "Profile with id: \'" + profileId + "\' has been explicitly deactivated." ); ++ } catch ( ComponentLookupException e ) { ++ throw new RuntimeException( e ); ++ } + + deactivatedIds.add( profileId ); + } +@@ -294,7 +308,11 @@ public class DefaultProfileManager + } + catch ( ComponentLifecycleException e ) + { +- container.getLogger().debug( "Error releasing profile activators - ignoring.", e ); ++ try { ++ container.lookup( Logger.class ).debug( "Error releasing profile activators - ignoring.", e ); ++ } catch ( ComponentLookupException ex ) { ++ throw new RuntimeException( ex ); ++ } + } + } + } +-- +1.8.1.4 + diff --git a/maven2.spec b/maven2.spec new file mode 100644 index 0000000..746b506 --- /dev/null +++ b/maven2.spec @@ -0,0 +1,153 @@ +Name: maven2 +Version: 2.2.1 +Release: 60 +License: ASL 2.0 +Summary: Software project management and comprehension tool +URL: http://maven.apache.org +BuildArch: noarch + +Source0: https://archive.apache.org/dist/maven/maven-2/2.2.1/source/apache-maven-2.2.1-src.tar.gz + +Patch0001: %{name}-%{version}-migrate-to-plexus-containers-container-default.patch + +BuildRequires: maven-local mvn(org.apache.maven:maven-parent:pom:) mvn(org.apache.maven.plugins:maven-enforcer-plugin) +BuildRequires: mvn(org.apache.maven.plugins:maven-shade-plugin) mvn(org.apache.maven.wagon:wagon-provider-api) +BuildRequires: mvn(org.codehaus.modello:modello-maven-plugin) mvn(org.codehaus.plexus:plexus-container-default) +BuildRequires: mvn(org.codehaus.plexus:plexus-interpolation) mvn(org.codehaus.plexus:plexus-utils) + +%description +Apache Maven is a Java project management and project comprehension tool. +Based on the concept of a project object model (POM),according to a central piece of +information, Maven can manage a project's build, reporting and documentation. + +%package -n maven-artifact +Summary: Maven artifact artifact + +%description -n maven-artifact +Compatibility Maven artifact manager artifact + +%package -n maven-model +Summary: Maven model artifact + +%description -n maven-model +Compatibility Maven model artifact + +%package -n maven-artifact-manager +Summary: Maven artifact manager artifact + +%description -n maven-artifact-manager +Compatibility Maven artifact manager artifact + +%package -n maven-monitor +Summary: Maven monitor artifact + +%description -n maven-monitor +Compatibility Maven monitor artifact + +%package -n maven-toolchain +Summary: Maven toolchain artifact + +%description -n maven-toolchain +Compatibility Maven toolchain artifact + +%package -n maven-settings +Summary: Maven settings artifact + +%description -n maven-settings +Compatibility Maven settings artifact + +%package -n maven-plugin-descriptor +Summary: Compatibility Maven Plugin Description Model + +%description -n maven-plugin-descriptor +Compatibility Maven plugin descriptor artifact + +%package -n maven-plugin-registry +Summary: Maven plugin registry artifact + +%description -n maven-plugin-registry +Compatibility Maven plugin registry artifact + +%package -n maven-project +Summary: Maven project artifact + +%description -n maven-project +Compatibility Maven project artifact + +%package -n maven-profile +Summary: Maven profile artifact + +%description -n maven-profile +Compatibility Compatibility Maven profile artifact + +%package help +Summary: Help documentation for %{name} +Provides: %{name}-javadoc = %{version}-%{release} +Obsoletes: %{name}-javadoc < %{version}-%{release} + +%description help +Man pages and other related help documents for %{name}. + +%prep +%autosetup -n apache-maven-%{version} -p1 + +for nobuild in apache-maven maven-artifact-test maven-compat maven-core maven-plugin-api \ + maven-plugin-parameter-documenter maven-reporting \ + maven-repository-metadata maven-script maven-error-diagnostics; do + %pom_disable_module $nobuild +done + +%mvn_package :maven __noinstall +%mvn_file ":{*}" maven/@1 +%mvn_compat_version ":maven-{artifact,model,settings}" 2.0.2 2.0.6 2.0.7 2.0.8 2.2.1 + +%pom_remove_dep :backport-util-concurrent +%pom_remove_dep :backport-util-concurrent maven-artifact-manager +sed -i s/edu.emory.mathcs.backport.// `find -name DefaultArtifactResolver.java` + +for pom in $(grep -l ">test<" $(find -name pom.xml | grep -v /test/)); do + %pom_xpath_remove "pom:dependency[pom:scope[text()='test']]" $pom +done + +%build +%mvn_build -f -s -- -P all-models + +%install +%mvn_install + +%files -n maven-artifact -f .mfiles-maven-artifact +%license apache-maven/LICENSE.txt apache-maven/NOTICE.txt + +%files -n maven-model -f .mfiles-maven-model +%license apache-maven/LICENSE.txt apache-maven/NOTICE.txt + +%files -n maven-monitor -f .mfiles-maven-monitor +%license apache-maven/LICENSE.txt apache-maven/NOTICE.txt + +%files -n maven-artifact-manager -f .mfiles-maven-artifact-manager +%license apache-maven/LICENSE.txt apache-maven/NOTICE.txt + +%files -n maven-plugin-registry -f .mfiles-maven-plugin-registry +%license apache-maven/LICENSE.txt apache-maven/NOTICE.txt + +%files -n maven-settings -f .mfiles-maven-settings +%license apache-maven/LICENSE.txt apache-maven/NOTICE.txt + +%files -n maven-toolchain -f .mfiles-maven-toolchain +%license apache-maven/LICENSE.txt apache-maven/NOTICE.txt + +%files -n maven-profile -f .mfiles-maven-profile +%license apache-maven/LICENSE.txt apache-maven/NOTICE.txt + +%files -n maven-project -f .mfiles-maven-project +%license apache-maven/LICENSE.txt apache-maven/NOTICE.txt + +%files -n maven-plugin-descriptor -f .mfiles-maven-plugin-descriptor +%license apache-maven/LICENSE.txt apache-maven/NOTICE.txt + +%files help -f .mfiles-javadoc + +%changelog +* Fri Dec 6 2019 wangzhishun - 2.2.1-60 +- Package init +