[plexus-resources] Build with maven 3.x
by Alexander Kurtakov
commit 7fe18d7e768afb3b51e954e5eea9276fb0442935
Author: Alexander Kurtakov <akurtakov(a)gmail.com>
Date: Sun Jun 12 14:39:42 2011 +0300
Build with maven 3.x
...fault-role-hint-to-DefaultResourceManager.patch | 25 ---------
plexus-resources-1.0-jpp-depmap.xml | 14 -----
plexus-resources-settings.xml | 47 ----------------
plexus-resources.spec | 56 +++++---------------
4 files changed, 14 insertions(+), 128 deletions(-)
---
diff --git a/plexus-resources.spec b/plexus-resources.spec
index f85d6c1..0cff732 100644
--- a/plexus-resources.spec
+++ b/plexus-resources.spec
@@ -34,7 +34,7 @@
Name: %{parent}-%{subname}
Version: 1.0
-Release: 0.4.a7%{?dist}
+Release: 0.5.a7%{?dist}
Summary: Plexus Resource Manager
License: MIT
Group: Development/Tools
@@ -42,9 +42,6 @@ URL: http://plexus.codehaus.org/
# svn export http://svn.codehaus.org/plexus/plexus-components/tags/plexus-resources-1....
# tar caf plexus-resources-1.0-alpha-7-src.tar.xz plexus-resources-1.0-alpha-7
Source0: %{name}-%{version}-alpha-7-src.tar.xz
-Source3: plexus-resources-settings.xml
-Source4: plexus-resources-1.0-jpp-depmap.xml
-Patch0: 0001-Add-default-role-hint-to-DefaultResourceManager.patch
Requires: classworlds >= 0:1.1
Requires: plexus-container-default
Requires: plexus-utils
@@ -54,14 +51,14 @@ Requires(postun): jpackage-utils >= 0:1.7.3
BuildRequires: jpackage-utils >= 0:1.7.3
BuildRequires: java-devel >= 0:1.5.0
BuildRequires: ant >= 0:1.6
-BuildRequires: maven2
+BuildRequires: maven
BuildRequires: maven-compiler-plugin
BuildRequires: maven-install-plugin
BuildRequires: maven-jar-plugin
BuildRequires: maven-javadoc-plugin
BuildRequires: maven-release-plugin
BuildRequires: maven-resources-plugin
-BuildRequires: maven-surefire-maven-plugin
+BuildRequires: maven-surefire-plugin
BuildRequires: maven-surefire-provider-junit
BuildRequires: maven-doxia
BuildRequires: maven-doxia-sitetools
@@ -70,7 +67,6 @@ BuildRequires: plexus-container-default
BuildRequires: plexus-utils
BuildArch: noarch
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%description
The Plexus project seeks to create end-to-end developer tools for
@@ -83,58 +79,34 @@ is like a J2EE application server, without all the baggage.
%package javadoc
Summary: Javadoc for %{name}
Group: Documentation
+Requires: jpackage-utils
%description javadoc
API documentation for %{name}.
%prep
%setup -q -n %{name}-%{namedversion}
-cp -p %{SOURCE3} settings.xml
-%patch0 -p1
%build
-sed -i -e "s|<url>__JPP_URL_PLACEHOLDER__</url>|<url>file://`pwd`/.m2/repository</url>|g" settings.xml
-sed -i -e "s|<url>__JAVADIR_PLACEHOLDER__</url>|<url>file://`pwd`/external_repo</url>|g" settings.xml
-sed -i -e "s|<url>__MAVENREPO_DIR_PLACEHOLDER__</url>|<url>file://`pwd`/.m2/repository</url>|g" settings.xml
-sed -i -e "s|<url>__MAVENDIR_PLUGIN_PLACEHOLDER__</url>|<url>file:///usr/share/maven2/plugins</url>|g" settings.xml
-sed -i -e "s|<url>__ECLIPSEDIR_PLUGIN_PLACEHOLDER__</url>|<url>file:///usr/share/eclipse/plugins</url>|g" settings.xml
-
-export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
-mkdir -p $MAVEN_REPO_LOCAL
-
-mkdir external_repo
-ln -s %{_javadir} external_repo/JPP
-
-mvn-jpp \
- -e \
- -s $(pwd)/settings.xml \
- -Dmaven2.jpp.mode=true \
- -Dmaven2.jpp.depmap.file=%{SOURCE4} \
- -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
+mvn-rpmbuild \
+ -Dmaven.test.failure.ignore=true \
install javadoc:javadoc
%install
-rm -rf $RPM_BUILD_ROOT
# jars
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}/plexus
install -pm 644 target/%{name}-%{namedversion}.jar \
- $RPM_BUILD_ROOT%{_javadir}/plexus/%{subname}-%{version}.jar
+ $RPM_BUILD_ROOT%{_javadir}/plexus/%{subname}.jar
%add_to_maven_depmap org.codehaus.plexus %{name} %{namedversion} JPP/%{parent} %{subname}
-(cd $RPM_BUILD_ROOT%{_javadir}/plexus && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
-
# poms
-install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms
+install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
install -pm 644 pom.xml \
- $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{parent}-%{subname}.pom
+ $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{parent}-%{subname}.pom
# javadoc
-install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
-cp -pr target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
-ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}
-
-%clean
-rm -rf $RPM_BUILD_ROOT
+install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}
+cp -pr target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
%post
%update_maven_depmap
@@ -143,17 +115,17 @@ rm -rf $RPM_BUILD_ROOT
%update_maven_depmap
%files
-%defattr(-,root,root,-)
%{_javadir}/%{parent}/*
%{_mavenpomdir}/*
%{_mavendepmapfragdir}/*
%files javadoc
-%defattr(-,root,root,-)
-%{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}
%changelog
+* Sun Jun 12 2011 Alexander Kurtakov <akurtako(a)redhat.com> 1.0-0.5.a7
+- Build with maven 3.x
+
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> - 1.0-0.4.a7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
12 years, 11 months
[plexus-cli] Remove not needed sources and patches.
by Alexander Kurtakov
commit 9d3a648c230a7074c9804484ab7b10bc04b71c7c
Author: Alexander Kurtakov <akurtakov(a)gmail.com>
Date: Sun Jun 12 14:28:08 2011 +0300
Remove not needed sources and patches.
plexus-cli-1.2-build.xml | 129 -----------------------------------------
plexus-cli-1.2-jpp-depmap.xml | 14 -----
plexus-cli-settings.xml | 47 ---------------
3 files changed, 0 insertions(+), 190 deletions(-)
12 years, 11 months
[plexus-cli] Build with maven 3.x
by Alexander Kurtakov
commit 25575ccec7acf4990e4b0701a7720508985f9edd
Author: Alexander Kurtakov <akurtakov(a)gmail.com>
Date: Sun Jun 12 14:27:42 2011 +0300
Build with maven 3.x
plexus-cli.spec | 96 +++++++++++++++---------------------------------------
1 files changed, 27 insertions(+), 69 deletions(-)
---
diff --git a/plexus-cli.spec b/plexus-cli.spec
index 327a687..e9526e1 100644
--- a/plexus-cli.spec
+++ b/plexus-cli.spec
@@ -28,15 +28,12 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
-%define with_maven 0
-
-%define parent plexus
-%define subname cli
-%define namedversion 1.2
+%global parent plexus
+%global subname cli
Name: %{parent}-%{subname}
Version: 1.2
-Release: 9%{?dist}
+Release: 10%{?dist}
Epoch: 0
Summary: Command Line Interface facilitator for Plexus
License: ASL 2.0 and Plexus
@@ -45,40 +42,32 @@ URL: http://plexus.codehaus.org/
# svn export http://svn.codehaus.org/plexus/archive/plexus-tools/tags/plexus-cli-1.2
# tar czf plexus-cli-%{version}-src.tar.gz plexus-cli-%{version}
# Note: Exported revision 8188.
-Source0: %{name}-%{namedversion}-src.tar.gz
-
-Source1: plexus-cli-1.2-build.xml
-Source2: plexus-cli-settings.xml
-Source3: plexus-cli-1.2-jpp-depmap.xml
+Source0: %{name}-%{version}-src.tar.gz
# License headers missing from some files
# http://jira.codehaus.org/browse/PLX-418
Patch0: plexus-cli-licenseheaders.patch
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
BuildArch: noarch
BuildRequires: jpackage-utils >= 0:1.7.3
BuildRequires: ant >= 0:1.6.5
BuildRequires: junit
-%if %{with_maven}
-BuildRequires: maven2 >= 2.0.4-10jpp
-BuildRequires: maven2-plugin-compiler
-BuildRequires: maven2-plugin-install
-BuildRequires: maven2-plugin-jar
-BuildRequires: maven2-plugin-javadoc
-BuildRequires: maven2-plugin-resources
-BuildRequires: maven2-plugin-surefire = 2.3
-BuildRequires: maven-surefire-provider-junit = 2.3
+BuildRequires: maven
+BuildRequires: maven-compiler-plugin
+BuildRequires: maven-install-plugin
+BuildRequires: maven-jar-plugin
+BuildRequires: maven-javadoc-plugin
+BuildRequires: maven-resources-plugin
+BuildRequires: maven-surefire-plugin
+BuildRequires: maven-surefire-provider-junit
BuildRequires: maven-doxia
BuildRequires: maven-doxia-sitetools
BuildRequires: maven-release
-%endif
BuildRequires: plexus-classworlds
BuildRequires: plexus-containers-container-default
BuildRequires: plexus-utils
-BuildRequires: jakarta-commons-cli
+BuildRequires: apache-commons-cli
Requires: plexus-classworlds
Requires: plexus-containers-container-default
@@ -97,67 +86,35 @@ is like a J2EE application server, without all the baggage.
%package javadoc
Summary: Javadoc for %{name}
Group: Documentation
+Requires: jpackage-utils
%description javadoc
Javadoc for %{name}.
%prep
-%setup -q -n %{name}-%{namedversion}
+%setup -q
find . -name "*.jar" -exec rm -f {} \;
-#for j in $(find . -name "*.jar" ); do
-# mv $j $j.no
-#done
%patch0 -p3
-cp %{SOURCE1} build.xml
-cp %{SOURCE2} settings.xml
-
%build
-export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
-mkdir -p $MAVEN_REPO_LOCAL
-
-%if %{with_maven}
-mvn-jpp \
- -e \
- -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
- -Dmaven2.jpp.depmap.file=%{SOURCE3} \
+mvn-rpmbuild \
install javadoc:javadoc
-%else
-export CLASSPATH=$(build-classpath \
-plexus/classworlds \
-plexus/containers-container-default \
-plexus/utils \
-commons-cli \
-)
-CLASSPATH=$CLASSPATH:target/classes:target/test-classes
-
-ant -Dbuild.sysclasspath=only jar javadoc
-%endif
-
-
%install
-rm -rf $RPM_BUILD_ROOT
# jars
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}/plexus
-install -pm 644 target/%{name}-%{namedversion}.jar \
- $RPM_BUILD_ROOT%{_javadir}/plexus/%{subname}-%{version}.jar
+install -pm 644 target/%{name}-%{version}.jar \
+ $RPM_BUILD_ROOT%{_javadir}/plexus/%{subname}.jar
%add_to_maven_depmap org.codehaus.plexus %{name} %{namedversion} JPP/%{parent} %{subname}
-(cd $RPM_BUILD_ROOT%{_javadir}/%{parent} && for jar in *-%{version}*; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
-
# pom
-install -d -m 755 $RPM_BUILD_ROOT%{_datadir}/maven2/poms
-install -pm 644 pom.xml $RPM_BUILD_ROOT%{_datadir}/maven2/poms/JPP.%{parent}-%{subname}.pom
+install -d -m 755 $RPM_BUILD_ROOT%{_mavenpomdir}
+install -pm 644 pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{parent}-%{subname}.pom
# javadoc
-install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
-cp -pr target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
-ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name}
-
-%clean
-rm -rf $RPM_BUILD_ROOT
+install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}
+cp -pr target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
%post
%update_maven_depmap
@@ -166,17 +123,18 @@ rm -rf $RPM_BUILD_ROOT
%update_maven_depmap
%files
-%defattr(-,root,root,-)
%{_javadir}/%{parent}/*
-%{_datadir}/maven2
-%{_mavendepmapfragdir}
+%{_mavenpomdir}/*
+%{_mavendepmapfragdir}/*
%files javadoc
-%defattr(-,root,root,-)
%doc %{_javadocdir}/*
%changelog
+* Sun Jun 12 2011 Alexander Kurtakov <akurtako(a)redhat.com> 0:1.2-10
+- Build with maven 3.x
+
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> - 0:1.2-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
12 years, 11 months
[plexus-cdc] Build with maven 3.x
by Alexander Kurtakov
commit 2533692da454def2cb7ac0c09dd2d3e08c13e855
Author: Alexander Kurtakov <akurtakov(a)gmail.com>
Date: Sun Jun 12 14:15:25 2011 +0300
Build with maven 3.x
plexus-cdc.spec | 44 ++++++++++----------------------------------
1 files changed, 10 insertions(+), 34 deletions(-)
---
diff --git a/plexus-cdc.spec b/plexus-cdc.spec
index fe89942..b67954f 100644
--- a/plexus-cdc.spec
+++ b/plexus-cdc.spec
@@ -36,7 +36,7 @@
Name: %{parent}-%{subname}
Version: 1.0
-Release: 0.9.a14%{?dist}
+Release: 0.10.a14%{?dist}
Epoch: 0
Summary: Plexus Component Descriptor Creator
License: MIT
@@ -48,26 +48,22 @@ Source0: %{name}-1.0-alpha-14.tar.gz
Source1: %{name}-jpp-depmap.xml
Patch0: %{name}-qdox-1.9.patch
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
BuildArch: noarch
BuildRequires: jpackage-utils >= 0:1.7.2
-BuildRequires: maven2
+BuildRequires: maven
BuildRequires: maven-compiler-plugin
BuildRequires: maven-install-plugin
BuildRequires: maven-jar-plugin
BuildRequires: maven-javadoc-plugin
BuildRequires: maven-resources-plugin
-BuildRequires: maven-surefire-maven-plugin
-BuildRequires: maven2-common-poms >= 1.0
+BuildRequires: maven-surefire-plugin
BuildRequires: jdom
BuildRequires: plexus-container-default
BuildRequires: plexus-utils
BuildRequires: maven-doxia-sitetools
BuildRequires: qdox
Requires: jdom
-Requires: maven2-common-poms >= 1.0
Requires: plexus-container-default
Requires: plexus-utils
Requires: qdox
@@ -93,47 +89,27 @@ Javadoc for %{name}.
%prep
%setup -q -n %{name}
-#mkdir external_repo
-#ln -s %{_javadir} external_repo/JPP
%patch0 -p1
-
%build
-
-export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
-mkdir -p $MAVEN_REPO_LOCAL
-
-mvn-jpp \
- -e \
- -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
+mvn-rpmbuild \
-Dmaven.test.skip=true \
install javadoc:javadoc
-
%install
-rm -rf $RPM_BUILD_ROOT
# jars
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}/plexus
install -pm 644 target/*.jar \
- $RPM_BUILD_ROOT%{_javadir}/%{parent}/%{subname}-%{version}.jar
+ $RPM_BUILD_ROOT%{_javadir}/%{parent}/%{subname}.jar
%add_to_maven_depmap org.codehaus.plexus %{name} 1.0-alpha-14 JPP/%{parent} %{subname}
-(cd $RPM_BUILD_ROOT%{_javadir}/%{parent} && for jar in *-%{version}*; \
- do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
-
# pom
install -Dpm 644 pom.xml $RPM_BUILD_ROOT%{_mavenpomdir}/JPP.%{parent}-%{subname}.pom
# javadoc
-install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}
-
-cp -pr target/site/apidocs/* \
- $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version}/
+install -d -m 755 $RPM_BUILD_ROOT%{_javadocdir}/%{name}
-ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} # ghost symlink
-
-%clean
-rm -rf $RPM_BUILD_ROOT
+cp -pr target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}/
%post
%update_maven_depmap
@@ -142,17 +118,17 @@ rm -rf $RPM_BUILD_ROOT
%update_maven_depmap
%files
-%defattr(-,root,root,-)
%{_javadir}/plexus
%{_mavenpomdir}/*
%{_mavendepmapfragdir}/*
-%config(noreplace) /etc/maven/fragments/plexus-cdc
%files javadoc
-%defattr(-,root,root,-)
%doc %{_javadocdir}/*
%changelog
+* Sun Jun 12 2011 Alexander Kurtakov <akurtako(a)redhat.com> 0:1.0-0.10.a14
+- Build with maven 3.x
+
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> - 0:1.0-0.9.a14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
12 years, 11 months
[plexus-active-collections] Build with maven 3.x.
by Alexander Kurtakov
commit 36c625d4e0c9287220f3100ce6d5c6c4b04f72ef
Author: Alexander Kurtakov <akurtakov(a)gmail.com>
Date: Sun Jun 12 14:07:36 2011 +0300
Build with maven 3.x.
plexus-active-collections.spec | 62 +++++++++++++++-------------------------
1 files changed, 23 insertions(+), 39 deletions(-)
---
diff --git a/plexus-active-collections.spec b/plexus-active-collections.spec
index 7cbfe25..ba6bd23 100644
--- a/plexus-active-collections.spec
+++ b/plexus-active-collections.spec
@@ -1,8 +1,8 @@
-%define project_version 1.0-beta-2
+%global project_version 1.0-beta-2
Name: plexus-active-collections
Version: 1.0
-Release: 0.3.beta2%{?dist}
+Release: 0.4.beta2%{?dist}
Summary: Plexus Container-Backed Active Collections
Group: Development/Libraries
@@ -11,26 +11,25 @@ URL: http://plexus.codehaus.org/
#svn export http://svn.codehaus.org/plexus/tags/plexus-active-collections-1.0-beta-2/
#tar zcf plexus-active-collections-1.0-beta-2.tar.gz plexus-active-collections-1.0-beta-2/
Source0: plexus-active-collections-1.0-beta-2.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: java >= 1:1.6.0
BuildRequires: jpackage-utils >= 0:1.7.2
-BuildRequires: ant, ant-nodeps
-BuildRequires: maven2 >= 0:2.0.4-9
-BuildRequires: maven2-plugin-assembly
-BuildRequires: maven2-plugin-compiler
-BuildRequires: maven2-plugin-install
-BuildRequires: maven2-plugin-jar
-BuildRequires: maven2-plugin-resources
-BuildRequires: maven2-plugin-site
-BuildRequires: maven2-plugin-plugin
-BuildRequires: maven-surefire-maven-plugin
+BuildRequires: ant
+BuildRequires: maven
+BuildRequires: maven-assembly-plugin
+BuildRequires: maven-compiler-plugin
+BuildRequires: maven-install-plugin
+BuildRequires: maven-jar-plugin
+BuildRequires: maven-resources-plugin
+BuildRequires: maven-site-plugin
+BuildRequires: maven-plugin-plugin
+BuildRequires: maven-surefire-plugin
BuildRequires: maven-surefire-provider-junit
-BuildRequires: maven2-plugin-javadoc
+BuildRequires: maven-javadoc-plugin
BuildRequires: maven-shared-reporting-impl
-BuildRequires: maven-shared-plugin-testing-harness
+BuildRequires: maven-plugin-testing-harness
BuildRequires: maven-doxia
BuildRequires: maven-doxia-sitetools
BuildRequires: plexus-maven-plugin
@@ -54,8 +53,7 @@ Plexus Container-Backed Active Collections
%package javadoc
Group: Documentation
Summary: Javadoc for %{name}
-
-Requires: plexus-utils
+Requires: jpackage-utils
%description javadoc
API documentation for %{name}.
@@ -65,23 +63,14 @@ API documentation for %{name}.
%setup -q -n %{name}-%{project_version}
%build
-export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
-mvn-jpp \
- -e \
- -Dmaven2.jpp.mode=true \
- -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
- -Dmaven.test.skip=true \
+mvn-rpmbuild \
+ -Dmaven.test.failure.ignore=true \
install javadoc:javadoc
%install
-rm -rf %{buildroot}
-
# jars
install -d -m 0755 %{buildroot}%{_javadir}/plexus
-install -m 644 target/%{name}-%{project_version}.jar %{buildroot}%{_javadir}/plexus
-
-(cd %{buildroot}%{_javadir}/plexus && for jar in *-%{project_version}*; \
- do ln -sf ${jar} `echo $jar| sed "s|-%{project_version}||g"`; done)
+install -m 644 target/%{name}-%{project_version}.jar %{buildroot}%{_javadir}/plexus/%{name}.jar
%add_to_maven_depmap org.codehaus.plexus %{name} %{project_version} JPP/plexus %{name}
@@ -91,10 +80,8 @@ install -pm 644 pom.xml \
%{buildroot}%{_mavenpomdir}/JPP.plexus-%{name}.pom
# javadoc
-install -d -m 0755 %{buildroot}%{_javadocdir}/plexus/%{name}-%{version}
-cp -pr target/site/api*/* %{buildroot}%{_javadocdir}/plexus/%{name}-%{version}/
-ln -s %{name}-%{version} %{buildroot}%{_javadocdir}/plexus/%{name}
-rm -rf target/site/api*
+install -d -m 0755 %{buildroot}%{_javadocdir}/plexus/%{name}
+cp -pr target/site/api*/* %{buildroot}%{_javadocdir}/plexus/%{name}/
%post
%update_maven_depmap
@@ -102,21 +89,18 @@ rm -rf target/site/api*
%postun
%update_maven_depmap
-%clean
-rm -rf %{buildroot}
-
%files
-%defattr(-,root,root,-)
%{_javadir}/plexus/*
%{_mavenpomdir}/*
%{_mavendepmapfragdir}/*
%files javadoc
-%defattr(-,root,root,-)
-%{_javadocdir}/plexus/%{name}-%{version}
%{_javadocdir}/plexus/%{name}
%changelog
+* Sun Jun 12 2011 Alexander Kurtakov <akurtako(a)redhat.com> 1.0-0.4.beta2
+- Build with maven 3.x.
+
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> - 1.0-0.3.beta2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
12 years, 11 months
[maven] Resolve poms also from /usr/share/maven-poms
by Stanislav Ochotnicky
commit a170a2aaad3a7a30094b5438614f53ce0e82e7fc
Author: Stanislav Ochotnicky <sochotnicky(a)redhat.com>
Date: Fri Jun 10 11:17:07 2011 +0200
Resolve poms also from /usr/share/maven-poms
This will enable us to move fragments from etc
JavadirWorkspaceReader.java | 17 ++++++++++++-----
maven.spec | 2 ++
2 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/JavadirWorkspaceReader.java b/JavadirWorkspaceReader.java
index 22033cb..b84974b 100644
--- a/JavadirWorkspaceReader.java
+++ b/JavadirWorkspaceReader.java
@@ -1,15 +1,14 @@
package org.apache.maven.artifact.resolver;
-import org.apache.maven.artifact.repository.MavenJPackageDepmap;
-
import java.io.File;
-import java.util.List;
-import java.util.LinkedList;
import java.util.Hashtable;
+import java.util.LinkedList;
+import java.util.List;
+import org.apache.maven.artifact.repository.MavenJPackageDepmap;
+import org.sonatype.aether.artifact.Artifact;
import org.sonatype.aether.repository.WorkspaceReader;
import org.sonatype.aether.repository.WorkspaceRepository;
-import org.sonatype.aether.artifact.Artifact;
public class JavadirWorkspaceReader implements WorkspaceReader {
private WorkspaceRepository workspaceRepository;
@@ -101,12 +100,20 @@ public class JavadirWorkspaceReader implements WorkspaceReader {
return new StringBuffer(f.getPath());
}
+ // now maven 3 specific repository
f = new File(System.getProperty("maven.local.default.repo",
"/usr/share/maven/repository") + "/" + m3path);
if (f.exists()) {
return new StringBuffer(f.getPath());
}
+ // now try new path in /usr. This will be the only check after all
+ // packages are rebuilt
+ f = new File("/usr/share/maven-poms/" + fName);
+ if (f.exists()) {
+ return new StringBuffer(f.getPath());
+ }
+
// final fallback to m2 default poms
return new StringBuffer("/usr/share/maven2/repository/"
+ System.getProperty("maven.local.default.repo",
diff --git a/maven.spec b/maven.spec
index 5b7f202..ebddb71 100644
--- a/maven.spec
+++ b/maven.spec
@@ -310,6 +310,8 @@ cp -pr target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
%changelog
* Fri Jun 10 2011 Stanislav Ochotnicky <sochotnicky(a)redhat.com> - 3.0.3-5
- Process fragments directly instead of maven2-depmap.xml
+- Expect fragments in /usr/share/maven-fragments
+- Resolve poms also from /usr/share/maven-poms
* Mon Jun 6 2011 Stanislav Ochotnicky <sochotnicky(a)redhat.com> - 3.0.3-4
- Add help to mvn-rpmbuild and mvn-local (rhbz#710448)
12 years, 11 months
[maven] Process fragments directly instead of maven2-depmap.xml
by Stanislav Ochotnicky
commit bdbc16d2c10552f943177d5c6f7f7d285ab7ba8d
Author: Stanislav Ochotnicky <sochotnicky(a)redhat.com>
Date: Fri Jun 10 10:33:20 2011 +0200
Process fragments directly instead of maven2-depmap.xml
Fragments are also expected in /usr/share/maven-fragments where they
should be moved (backward compat preserved for now).
Big changes are due to reformatting to use spaces (sorry, cleaner
log/diff in separate resolver repo)
JavadirWorkspaceReader.java | 60 +++---
MavenJPackageDepmap.java | 480 +++++++++++++++++++++++++------------------
maven.spec | 5 +-
3 files changed, 319 insertions(+), 226 deletions(-)
---
diff --git a/JavadirWorkspaceReader.java b/JavadirWorkspaceReader.java
index 8efd7e0..22033cb 100644
--- a/JavadirWorkspaceReader.java
+++ b/JavadirWorkspaceReader.java
@@ -11,16 +11,12 @@ import org.sonatype.aether.repository.WorkspaceReader;
import org.sonatype.aether.repository.WorkspaceRepository;
import org.sonatype.aether.artifact.Artifact;
-
-public class JavadirWorkspaceReader
- implements WorkspaceReader
-{
+public class JavadirWorkspaceReader implements WorkspaceReader {
private WorkspaceRepository workspaceRepository;
private static final char GROUP_SEPARATOR = '.';
private static final char PATH_SEPARATOR = '/';
-
public JavadirWorkspaceReader() {
workspaceRepository = new WorkspaceRepository("javadir-workspace");
}
@@ -29,8 +25,9 @@ public class JavadirWorkspaceReader
return workspaceRepository;
}
- public File findArtifact( Artifact artifact ) {
- MavenJPackageDepmap.debug("=============JAVADIRREADER-FIND_ARTIFACT: " + artifact.getArtifactId());
+ public File findArtifact(Artifact artifact) {
+ MavenJPackageDepmap.debug("=============JAVADIRREADER-FIND_ARTIFACT: "
+ + artifact.getArtifactId());
StringBuffer path = new StringBuffer();
String artifactId = artifact.getArtifactId();
@@ -42,7 +39,8 @@ public class JavadirWorkspaceReader
if (!groupId.startsWith("JPP")) {
MavenJPackageDepmap map = MavenJPackageDepmap.getInstance();
- Hashtable<String,String> newInfo = map.getMappedInfo(groupId, artifactId, version);
+ Hashtable<String, String> newInfo = map.getMappedInfo(groupId,
+ artifactId, version);
groupId = (String) newInfo.get("group");
artifactId = (String) newInfo.get("artifact");
@@ -54,32 +52,33 @@ public class JavadirWorkspaceReader
path = getPOMPath(groupId, artifactId);
} else if (artifact.getExtension().equals("signature")) {
path.append("/usr/share/maven/repository/");
- path.append( groupId ).append( '/' );
- path.append( artifactId ).append( ".signature" );
+ path.append(groupId).append('/');
+ path.append(artifactId).append(".signature");
} else if (artifact.getExtension().equals("zip")) {
path.append("/usr/share/maven/repository/");
- path.append( groupId ).append( '/' );
- path.append( artifactId ).append( ".zip" );
+ path.append(groupId).append('/');
+ path.append(artifactId).append(".zip");
} else {
- path.append("/usr/share/maven/repository/");
- path.append( groupId ).append( '/' );
- path.append( artifactId ).append( ".jar" );
+ path.append("/usr/share/maven/repository/");
+ path.append(groupId).append('/');
+ path.append(artifactId).append(".jar");
}
MavenJPackageDepmap.debug("Returning " + path.toString());
File ret = new File(path.toString());
// if file doesn't exist return null to delegate to other
// resolvers (reactor/local repo)
- if ( ret.isFile() ) {
+ if (ret.isFile()) {
MavenJPackageDepmap.debug("Returning " + path.toString());
return ret;
} else {
- MavenJPackageDepmap.debug("Returning null for gid:aid =>" + groupId + ":" + artifactId);
+ MavenJPackageDepmap.debug("Returning null for gid:aid =>" + groupId
+ + ":" + artifactId);
return null;
}
}
- public List<String> findVersions( Artifact artifact ) {
+ public List<String> findVersions(Artifact artifact) {
List<String> ret = new LinkedList<String>();
ret.add("latest");
return ret;
@@ -87,25 +86,30 @@ public class JavadirWorkspaceReader
private StringBuffer getPOMPath(String groupId, String artifactId) {
- String fName = groupId.replace(PATH_SEPARATOR, GROUP_SEPARATOR) + "-" + artifactId + ".pom";
- String m2path = System.getProperty("maven2.local.pom.path", "JPP/maven2/poms") + "/" + fName;
- String m3path = System.getProperty("maven.local.pom.path", "JPP/maven/poms") + "/" + fName;
+ String fName = groupId.replace(PATH_SEPARATOR, GROUP_SEPARATOR) + "-"
+ + artifactId + ".pom";
+ String m2path = System.getProperty("maven2.local.pom.path",
+ "JPP/maven2/poms") + "/" + fName;
+ String m3path = System.getProperty("maven.local.pom.path",
+ "JPP/maven/poms") + "/" + fName;
File f;
// let's try maven 2 repo first
- f = new File(System.getProperty("maven2.local.default.repo", "/usr/share/maven2/repository") + "/" + m2path);
- if ( f.exists() ) {
+ f = new File(System.getProperty("maven2.local.default.repo",
+ "/usr/share/maven2/repository") + "/" + m2path);
+ if (f.exists()) {
return new StringBuffer(f.getPath());
}
- f = new File(System.getProperty("maven.local.default.repo", "/usr/share/maven/repository") + "/" + m3path);
- if ( f.exists() ) {
+ f = new File(System.getProperty("maven.local.default.repo",
+ "/usr/share/maven/repository") + "/" + m3path);
+ if (f.exists()) {
return new StringBuffer(f.getPath());
}
// final fallback to m2 default poms
- return new StringBuffer("/usr/share/maven2/repository/" +
- System.getProperty("maven.local.default.repo", "JPP/maven2/default_poms") +
- "/" + fName);
+ return new StringBuffer("/usr/share/maven2/repository/"
+ + System.getProperty("maven.local.default.repo",
+ "JPP/maven2/default_poms") + "/" + fName);
}
}
diff --git a/MavenJPackageDepmap.java b/MavenJPackageDepmap.java
index 8cd1651..7fdc2ab 100644
--- a/MavenJPackageDepmap.java
+++ b/MavenJPackageDepmap.java
@@ -1,8 +1,10 @@
package org.apache.maven.artifact.repository;
-
+import java.io.File;
+import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
+import java.io.InputStream;
import java.util.Hashtable;
import java.util.StringTokenizer;
@@ -10,204 +12,288 @@ import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
-
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;
-import org.w3c.dom.*;
-
-
public class MavenJPackageDepmap {
- private static class ArtifactDefinition {
- String groupId = null;
- String artifactId = null;
- String version = null;
- }
-
- private static MavenJPackageDepmap instance;
- private static Hashtable<String, String> jppArtifactMap;
-
- private MavenJPackageDepmap() {
- jppArtifactMap = new Hashtable<String,String>();
- buildJppArtifactMap();
- }
-
- public static MavenJPackageDepmap getInstance() {
- if (instance == null) {
- instance = new MavenJPackageDepmap();
- }
-
- return instance;
- }
-
- public Hashtable<String, String> getMappedInfo(Hashtable<String, String> mavenDep) {
- return getMappedInfo((String) mavenDep.get("group"),
- (String) mavenDep.get("artifact"),
- (String) mavenDep.get("version"));
- }
-
- public Hashtable<String, String> getMappedInfo(String groupId, String artifactId, String version) {
-
- Hashtable<String, String> jppDep;
- String idToCheck, jppCombination;
-
- if (System.getProperty("maven.ignore.versions") == null && System.getProperty("maven.local.mode") == null) {
- idToCheck = groupId+","+artifactId+","+version;
- } else {
- idToCheck = groupId+","+artifactId;
- }
-
- jppCombination = (String) jppArtifactMap.get(idToCheck);
-
- //System.err.println("*** " + groupId+","+artifactId+","+version + " => " + jppCombination);
-
- jppDep = new Hashtable<String, String>();
- if (jppCombination != null && jppCombination != "") {
-
- StringTokenizer st = new StringTokenizer(jppCombination, ",");
-
- jppDep.put("group", st.nextToken());
- jppDep.put("artifact",st.nextToken());
- jppDep.put("version",st.nextToken());
-
- } else {
- jppDep.put("group", groupId);
- jppDep.put("artifact", artifactId);
- jppDep.put("version", version);
- }
-
- return jppDep;
- }
-
-
- /**
- * Returns whether or not the given dependency should be dropped.
- */
- public boolean shouldEliminate(String groupId, String artifactId, String version) {
- String idToCheck;
-
- if (System.getProperty("maven.ignore.versions") == null && System.getProperty("maven.local.mode") == null) {
- idToCheck = groupId+","+artifactId+","+version;
- } else {
- idToCheck = groupId+","+artifactId;
- }
-
- return jppArtifactMap.get(idToCheck) != null && jppArtifactMap.get(idToCheck).equals("");
-
- }
-
- private static void buildJppArtifactMap() {
-
- if (System.getProperty("maven.ignore.versions") != null || System.getProperty("maven.local.mode") != null) {
- debug("Processing file: /usr/share/java-utils/xml/maven2-versionless-depmap.xml");
- processDepmapFile("/etc/maven/maven2-versionless-depmap.xml");
- }
-
- debug("Processing file: /usr/share/java-utils/xml/maven2-depmap.xml");
- processDepmapFile("/etc/maven/maven2-depmap.xml");
-
- String customFileName = System.getProperty("maven.local.depmap.file", null);
- if (customFileName != null) {
- debug("Processing file: " + customFileName);
- processDepmapFile(customFileName);
- }
- }
-
- private static void processDepmapFile(String fileName) {
-
- Document mapDocument;
- debug("Loading depmap file: " + fileName);
- try {
- DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();
- fact.setNamespaceAware(true);
- DocumentBuilder builder = fact.newDocumentBuilder();
- mapDocument = builder.parse(fileName);
- } catch (FileNotFoundException fnfe) {
- System.err.println("ERROR: Unable to find map file: " + fileName);
- fnfe.printStackTrace();
- return;
- } catch (IOException ioe) {
- System.err.println("ERROR: I/O exception occured when opening map file");
- ioe.printStackTrace();
- return;
- } catch (ParserConfigurationException pce) {
- System.err.println("ERROR: Parsing of depmap file failed - configuration");
- pce.printStackTrace();
- return;
- } catch (SAXException se) {
- System.err.println("ERROR: Parsing of depmap file failed");
- se.printStackTrace();
- return;
- }
-
- NodeList depNodes = (NodeList) mapDocument.getElementsByTagName("dependency");
-
- for (int i = 0; i < depNodes.getLength(); i++) {
- Element depNode = (Element) depNodes.item(i);
-
- NodeList mavenNodeList = (NodeList) depNode.getElementsByTagName("maven");
- if (mavenNodeList.getLength() != 1) {
- debug("Number of maven sub-elements is not 1. Bailing from depmap generation");
- debug("Maven node: " + depNode.getTextContent());
- return;
- }
- ArtifactDefinition mavenAD = getArtifactDefinition((Element) mavenNodeList.item(0));
-
- ArtifactDefinition jppAD = null;
- NodeList jppNodeList = (NodeList) depNode.getElementsByTagName("jpp");
-
- if (jppNodeList.getLength() == 1) {
- jppAD = getArtifactDefinition((Element) jppNodeList.item(0));
- if (System.getProperty("maven.ignore.versions") == null && System.getProperty("maven.local.mode") == null) {
- debug("*** Adding: " + mavenAD.groupId + "," + mavenAD.artifactId + "," + mavenAD.version + " => "
- + jppAD.groupId + "," + jppAD.artifactId + "," + jppAD.version + " to map...");
-
- jppArtifactMap.put(mavenAD.groupId + "," + mavenAD.artifactId + "," + mavenAD.version,
- jppAD.groupId + "," + jppAD.artifactId + "," + jppAD.version);
- } else {
- debug("*** Adding: " + mavenAD.groupId+"," + mavenAD.artifactId + " => "
- + jppAD.groupId + "," + jppAD.artifactId + "," + jppAD.version + " to map...");
-
- jppArtifactMap.put(mavenAD.groupId+","+mavenAD.artifactId,
- jppAD.groupId + "," + jppAD.artifactId + "," + jppAD.version);
- }
- } else {
- debug("Number of jpp sub-elements is not 1. Dropping dependency");
- debug("*** Adding: " + mavenAD.groupId+","+mavenAD.artifactId+"," + " => " + "JPP/maven2,empty-dep,"+mavenAD.version + " to map...");
- jppArtifactMap.put(mavenAD.groupId+","+mavenAD.artifactId, "JPP/maven2,empty-dep,"+mavenAD.version);
- }
- }
- }
-
- private static ArtifactDefinition getArtifactDefinition(Element element) {
- ArtifactDefinition ad = new ArtifactDefinition();
-
- NodeList nodes = element.getElementsByTagName("groupId");
- if (nodes.getLength() != 1) {
- debug("groupId definition not found in depmap");
- return null;
- }
- ad.groupId = nodes.item(0).getTextContent();
-
- nodes = element.getElementsByTagName("artifactId");
- if (nodes.getLength() != 1) {
- debug("artifactId definition not found in depmap");
- return null;
- }
- ad.artifactId = nodes.item(0).getTextContent();
-
- nodes = element.getElementsByTagName("version");
- if (nodes.getLength() != 1) {
- ad.version = "DUMMY_VER";
- } else {
- ad.version = nodes.item(0).getTextContent();
- }
- return ad;
- }
-
-
- public static void debug(String msg) {
- if (System.getProperty("maven.local.debug") != null)
- System.err.println(msg);
- }
+ private static class ArtifactDefinition {
+ String groupId = null;
+ String artifactId = null;
+ String version = null;
+ }
+
+ /**
+ *
+ * @author Stanislav Ochotnicky <sochotnicky(a)redhat.com>
+ *
+ * This class is used to wrap around fragments that are mapping
+ * artifacts to jar files in our _javadir. These used to be
+ * processed in a macro after every package installation. Fragments
+ * themselves are not proper xml files (they have no root element)
+ * so we have to fix them by wrapping them in one root element.
+ */
+ private static class WrapFragmentStream extends InputStream {
+ String startTag = "<deps>";
+ String endTag = "</deps>";
+ byte fragmentContent[];
+ int position;
+
+ WrapFragmentStream(String fragmentPath) throws IOException {
+ FileInputStream fin = new FileInputStream(fragmentPath);
+ int nBytes = fin.available();
+ byte tmpContent[] = new byte[nBytes];
+ fin.read(tmpContent);
+ fin.close();
+ byte startBytes[] = startTag.getBytes();
+ byte endBytes[] = endTag.getBytes();
+ fragmentContent = new byte[nBytes + startBytes.length
+ + endBytes.length];
+ System.arraycopy(startBytes, 0, fragmentContent, 0,
+ startBytes.length);
+ System.arraycopy(tmpContent, 0, fragmentContent, startBytes.length,
+ tmpContent.length);
+ System.arraycopy(endBytes, 0, fragmentContent, startBytes.length
+ + tmpContent.length, endBytes.length);
+ position = 0;
+ }
+
+ public int read() throws IOException {
+ if (position < fragmentContent.length) {
+ return fragmentContent[position++];
+ } else {
+ return -1;
+ }
+ }
+ }
+
+ private static MavenJPackageDepmap instance;
+ private static Hashtable<String, String> jppArtifactMap;
+
+ private MavenJPackageDepmap() {
+ jppArtifactMap = new Hashtable<String, String>();
+ buildJppArtifactMap();
+ }
+
+ public static MavenJPackageDepmap getInstance() {
+ if (instance == null) {
+ instance = new MavenJPackageDepmap();
+ }
+
+ return instance;
+ }
+
+ public Hashtable<String, String> getMappedInfo(
+ Hashtable<String, String> mavenDep) {
+ return getMappedInfo((String) mavenDep.get("group"),
+ (String) mavenDep.get("artifact"),
+ (String) mavenDep.get("version"));
+ }
+
+ public Hashtable<String, String> getMappedInfo(String groupId,
+ String artifactId, String version) {
+
+ Hashtable<String, String> jppDep;
+ String idToCheck, jppCombination;
+
+ if (System.getProperty("maven.ignore.versions") == null
+ && System.getProperty("maven.local.mode") == null) {
+ idToCheck = groupId + "," + artifactId + "," + version;
+ } else {
+ idToCheck = groupId + "," + artifactId;
+ }
+
+ jppCombination = (String) jppArtifactMap.get(idToCheck);
+
+ // System.err.println("*** " + groupId+","+artifactId+","+version +
+ // " => " + jppCombination);
+
+ jppDep = new Hashtable<String, String>();
+ if (jppCombination != null && jppCombination != "") {
+
+ StringTokenizer st = new StringTokenizer(jppCombination, ",");
+
+ jppDep.put("group", st.nextToken());
+ jppDep.put("artifact", st.nextToken());
+ jppDep.put("version", st.nextToken());
+
+ } else {
+ jppDep.put("group", groupId);
+ jppDep.put("artifact", artifactId);
+ jppDep.put("version", version);
+ }
+
+ return jppDep;
+ }
+
+ /**
+ * Returns whether or not the given dependency should be dropped.
+ */
+ public boolean shouldEliminate(String groupId, String artifactId,
+ String version) {
+ String idToCheck;
+
+ if (System.getProperty("maven.ignore.versions") == null
+ && System.getProperty("maven.local.mode") == null) {
+ idToCheck = groupId + "," + artifactId + "," + version;
+ } else {
+ idToCheck = groupId + "," + artifactId;
+ }
+
+ return jppArtifactMap.get(idToCheck) != null
+ && jppArtifactMap.get(idToCheck).equals("");
+
+ }
+
+ private static void buildJppArtifactMap() {
+
+ if (System.getProperty("maven.ignore.versions") != null
+ || System.getProperty("maven.local.mode") != null) {
+ debug("Processing file: /usr/share/java-utils/xml/maven2-versionless-depmap.xml");
+ processDepmapFile("/etc/maven/maven2-versionless-depmap.xml");
+ }
+
+ // process fragments in etc
+ File fragmentDir = new File("/etc/maven/fragments");
+ String flist[] = fragmentDir.list();
+ if (flist != null)
+ for (String fragFilename : flist)
+ processDepmapFile("/etc/maven/fragments/" + fragFilename);
+
+ // process fragments is usr. Once packages are rebuilt, we can skip
+ // fragments in /etc
+ fragmentDir = new File("/usr/share/maven-fragments");
+ flist = fragmentDir.list();
+ if (flist != null)
+ for (String fragFilename : flist)
+ processDepmapFile("/usr/share/maven-fragments/" + fragFilename);
+
+ String customFileName = System.getProperty("maven.local.depmap.file",
+ null);
+ if (customFileName != null) {
+ debug("Processing file: " + customFileName);
+ processDepmapFile(customFileName);
+ }
+
+ }
+
+ private static void processDepmapFile(String fileName) {
+
+ Document mapDocument;
+ debug("Loading depmap file: " + fileName);
+ try {
+ DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();
+ fact.setNamespaceAware(true);
+ DocumentBuilder builder = fact.newDocumentBuilder();
+ // we can wrap even old depmaps, no harm done
+ WrapFragmentStream wfs = new WrapFragmentStream(fileName);
+ mapDocument = builder.parse(wfs);
+ wfs.close();
+ } catch (FileNotFoundException fnfe) {
+ System.err.println("ERROR: Unable to find map file: " + fileName);
+ fnfe.printStackTrace();
+ return;
+ } catch (IOException ioe) {
+ System.err
+ .println("ERROR: I/O exception occured when opening map file");
+ ioe.printStackTrace();
+ return;
+ } catch (ParserConfigurationException pce) {
+ System.err
+ .println("ERROR: Parsing of depmap file failed - configuration");
+ pce.printStackTrace();
+ return;
+ } catch (SAXException se) {
+ System.err.println("ERROR: Parsing of depmap file failed");
+ se.printStackTrace();
+ return;
+ }
+
+ NodeList depNodes = (NodeList) mapDocument
+ .getElementsByTagName("dependency");
+
+ for (int i = 0; i < depNodes.getLength(); i++) {
+ Element depNode = (Element) depNodes.item(i);
+
+ NodeList mavenNodeList = (NodeList) depNode
+ .getElementsByTagName("maven");
+ if (mavenNodeList.getLength() != 1) {
+ debug("Number of maven sub-elements is not 1. Bailing from depmap generation");
+ debug("Maven node: " + depNode.getTextContent());
+ return;
+ }
+ ArtifactDefinition mavenAD = getArtifactDefinition((Element) mavenNodeList
+ .item(0));
+
+ ArtifactDefinition jppAD = null;
+ NodeList jppNodeList = (NodeList) depNode
+ .getElementsByTagName("jpp");
+
+ if (jppNodeList.getLength() == 1) {
+ jppAD = getArtifactDefinition((Element) jppNodeList.item(0));
+ if (System.getProperty("maven.ignore.versions") == null
+ && System.getProperty("maven.local.mode") == null) {
+ debug("*** Adding: " + mavenAD.groupId + ","
+ + mavenAD.artifactId + "," + mavenAD.version
+ + " => " + jppAD.groupId + "," + jppAD.artifactId
+ + "," + jppAD.version + " to map...");
+
+ jppArtifactMap.put(mavenAD.groupId + ","
+ + mavenAD.artifactId + "," + mavenAD.version,
+ jppAD.groupId + "," + jppAD.artifactId + ","
+ + jppAD.version);
+ } else {
+ debug("*** Adding: " + mavenAD.groupId + ","
+ + mavenAD.artifactId + " => " + jppAD.groupId + ","
+ + jppAD.artifactId + "," + jppAD.version
+ + " to map...");
+
+ jppArtifactMap.put(mavenAD.groupId + ","
+ + mavenAD.artifactId, jppAD.groupId + ","
+ + jppAD.artifactId + "," + jppAD.version);
+ }
+ } else {
+ debug("Number of jpp sub-elements is not 1. Dropping dependency");
+ debug("*** Adding: " + mavenAD.groupId + ","
+ + mavenAD.artifactId + "," + " => "
+ + "JPP/maven2,empty-dep," + mavenAD.version
+ + " to map...");
+ jppArtifactMap.put(mavenAD.groupId + "," + mavenAD.artifactId,
+ "JPP/maven2,empty-dep," + mavenAD.version);
+ }
+ }
+ }
+
+ private static ArtifactDefinition getArtifactDefinition(Element element) {
+ ArtifactDefinition ad = new ArtifactDefinition();
+
+ NodeList nodes = element.getElementsByTagName("groupId");
+ if (nodes.getLength() != 1) {
+ debug("groupId definition not found in depmap");
+ return null;
+ }
+ ad.groupId = nodes.item(0).getTextContent();
+
+ nodes = element.getElementsByTagName("artifactId");
+ if (nodes.getLength() != 1) {
+ debug("artifactId definition not found in depmap");
+ return null;
+ }
+ ad.artifactId = nodes.item(0).getTextContent();
+
+ nodes = element.getElementsByTagName("version");
+ if (nodes.getLength() != 1) {
+ ad.version = "DUMMY_VER";
+ } else {
+ ad.version = nodes.item(0).getTextContent();
+ }
+ return ad;
+ }
+
+ public static void debug(String msg) {
+ if (System.getProperty("maven.local.debug") != null)
+ System.err.println(msg);
+ }
}
diff --git a/maven.spec b/maven.spec
index 4c0c1e0..5b7f202 100644
--- a/maven.spec
+++ b/maven.spec
@@ -1,7 +1,7 @@
Name: maven
Version: 3.0.3
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: Java project management and project comprehension tool
Group: Development/Tools
@@ -308,6 +308,9 @@ cp -pr target/site/apidocs/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}
%changelog
+* Fri Jun 10 2011 Stanislav Ochotnicky <sochotnicky(a)redhat.com> - 3.0.3-5
+- Process fragments directly instead of maven2-depmap.xml
+
* Mon Jun 6 2011 Stanislav Ochotnicky <sochotnicky(a)redhat.com> - 3.0.3-4
- Add help to mvn-rpmbuild and mvn-local (rhbz#710448)
12 years, 11 months
[maven-one-plugin] Build with maven 3.x.
by Alexander Kurtakov
commit 208e227c6ecec31c61a0f970338d026d860d4e2a
Author: Alexander Kurtakov <akurtakov(a)gmail.com>
Date: Thu Jun 9 23:00:25 2011 +0300
Build with maven 3.x.
Guidelines fixes.
maven-one-plugin.spec | 46 ++++++++++++++++------------------------------
1 files changed, 16 insertions(+), 30 deletions(-)
---
diff --git a/maven-one-plugin.spec b/maven-one-plugin.spec
index 627cd89..80561b2 100644
--- a/maven-one-plugin.spec
+++ b/maven-one-plugin.spec
@@ -1,6 +1,6 @@
Name: maven-one-plugin
Version: 1.2
-Release: 5%{?dist}
+Release: 6%{?dist}
Summary: Plugin provides some integration tasks with Maven 1.x
Group: Development/Libraries
@@ -10,26 +10,25 @@ URL: http://maven.apache.org/plugins/maven-one-plugin/
# tar jcf maven-one-plugin-1.2.tar.bz2 maven-one-plugin-1.2/
Source0: %{name}-%{version}.tar.bz2
Source1: %{name}-jpp-depmap.xml
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: java-devel >= 1:1.6.0
BuildRequires: plexus-utils
-BuildRequires: ant-nodeps
-BuildRequires: maven2
+BuildRequires: ant
+BuildRequires: maven
BuildRequires: maven-install-plugin
BuildRequires: maven-compiler-plugin
BuildRequires: maven-plugin-plugin
BuildRequires: maven-resources-plugin
-BuildRequires: maven-surefire-maven-plugin
+BuildRequires: maven-surefire-plugin
BuildRequires: maven-surefire-provider-junit
BuildRequires: maven-jar-plugin
BuildRequires: maven-javadoc-plugin
BuildRequires: maven-shared-model-converter
BuildRequires: jpackage-utils
-Requires: ant-nodeps
-Requires: maven2
+Requires: ant
+Requires: maven
Requires: maven-shared-model-converter
Requires: jpackage-utils
Requires: java
@@ -59,26 +58,17 @@ API documentation for %{name}.
%prep
-%setup -q #You may need to update this according to your Source0
+%setup -q
%build
-export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
-mvn-jpp \
- -e \
- -Dmaven2.jpp.mode=true \
- -Dmaven2.jpp.depmap.file=%{SOURCE1} \
- -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
+mvn-rpmbuild \
+ -Dmaven.local.depmap.file=%{SOURCE1} \
install javadoc:javadoc
%install
-rm -rf %{buildroot}
-
# jars
install -d -m 0755 %{buildroot}%{_javadir}
-install -m 644 target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
-
-(cd %{buildroot}%{_javadir} && for jar in *-%{version}*; \
- do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"`; done)
+install -m 644 target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar
%add_to_maven_depmap org.apache.maven.plugins %{name} %{version} JPP %{name}
@@ -88,10 +78,8 @@ install -pm 644 pom.xml \
%{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
# javadoc
-install -d -m 0755 %{buildroot}%{_javadocdir}/%{name}-%{version}
-cp -pr target/site/api*/* %{buildroot}%{_javadocdir}/%{name}-%{version}/
-ln -s %{name}-%{version} %{buildroot}%{_javadocdir}/%{name}
-rm -rf target/site/api*
+install -d -m 0755 %{buildroot}%{_javadocdir}/%{name}
+cp -pr target/site/api*/* %{buildroot}%{_javadocdir}/%{name}/
%post
%update_maven_depmap
@@ -99,21 +87,19 @@ rm -rf target/site/api*
%postun
%update_maven_depmap
-%clean
-rm -rf %{buildroot}
-
%files
-%defattr(-,root,root,-)
%{_javadir}/*
%{_mavenpomdir}/*
%{_mavendepmapfragdir}/*
%files javadoc
-%defattr(-,root,root,-)
-%{_javadocdir}/%{name}-%{version}
%{_javadocdir}/%{name}
%changelog
+* Thu Jun 9 2011 Alexander Kurtakov <akurtako(a)redhat.com> 1.2-6
+- Build with maven 3.x.
+- Guidelines fixes.
+
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng(a)lists.fedoraproject.org> - 1.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
12 years, 11 months
[maven-checkstyle-plugin] Fix checkstyle groupId.
by Alexander Kurtakov
commit 2110877e46c88d205e64202bbf3330b515d83853
Author: Alexander Kurtakov <akurtakov(a)gmail.com>
Date: Thu Jun 9 22:51:38 2011 +0300
Fix checkstyle groupId.
maven-checkstyle-plugin.spec | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/maven-checkstyle-plugin.spec b/maven-checkstyle-plugin.spec
index 345c7c9..74fd018 100644
--- a/maven-checkstyle-plugin.spec
+++ b/maven-checkstyle-plugin.spec
@@ -1,6 +1,6 @@
Name: maven-checkstyle-plugin
Version: 2.6
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: Plugin that generates a report regarding the code style used by the developers
Group: Development/Libraries
License: ASL 2.0
@@ -61,6 +61,8 @@ This package contains the API documentation for %{name}.
%prep
%setup -q
+#adapt to upstream checkstyle groupId
+sed -i -e "s|<groupId>checkstyle|<groupId>com.puppycrawl.tools|g" pom.xml
%build
mvn-rpmbuild \
@@ -100,6 +102,9 @@ ln -s %{name}-%{version} %{buildroot}%{_javadocdir}/%{name}
%{_javadocdir}/%{name}
%changelog
+* Thu Jun 9 2011 Alexander Kurtakov <akurtako(a)redhat.com> 2.6-5
+- Fix checkstyle groupId.
+
* Thu Jun 9 2011 Alexander Kurtakov <akurtako(a)redhat.com> 2.6-4
- Build with maven 3.x.
- Guideline fixes.
12 years, 11 months