File maven-shade-plugin.spec of Package maven-shade-plugin

%global bootstrap 1
%global _mavenpomdir /usr/share/maven2/poms
%global _mavendepmapfragdir /etc/maven/fragments

Name:           maven-shade-plugin
Version:        1.3.3
Release:        2%{?dist}
Summary:        This plugin provides the capability to package the artifact in an uber-jar

Group:          Development/Libraries
License:        ASL 2.0
URL:  {name}
# svn export
# tar caf maven-shade-plugin-1.3.3.tar.xz maven-shade-plugin-1.3.3
Source0:        %{name}-%{version}.tar.xz 
Source1:        %{name}.depmap
Patch0:         pom.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch: noarch

BuildRequires: java-devel 
BuildRequires: maven2
BuildRequires: mvn-helper xz
%if !%{bootstrap}
BuildRequires: jpackage-utils
BuildRequires: plexus-utils
BuildRequires: ant-nodeps
BuildRequires: maven2
BuildRequires: maven-wagon
BuildRequires: maven-enforcer-plugin
BuildRequires: plexus-container-default
BuildRequires: maven-install-plugin
BuildRequires: maven-compiler-plugin
BuildRequires: maven-plugin-plugin
BuildRequires: maven-resources-plugin
BuildRequires: maven-surefire-maven-plugin
BuildRequires: maven-surefire-provider-junit
BuildRequires: maven-jar-plugin
BuildRequires: maven-javadoc-plugin
BuildRequires: maven-shared-plugin-testing-harness

Requires: ant-nodeps
Requires: maven2
Requires: jpackage-utils
Requires: java 
Requires(post): jpackage-utils
Requires(postun): jpackage-utils 

Obsoletes: maven2-plugin-shade <= 0:2.0.8
Provides: maven2-plugin-shade = 1:%{version}-%{release}

This plugin provides the capability to package the artifact in an
uber-jar, including its dependencies and to shade - i.e. rename - the
packages of some of the dependencies.

# %package javadoc
# Group:          Documentation
# Summary:        API documentation for %{name}
# Requires:       jpackage-utils
# %description javadoc
# %{summary}.

%setup -q #You may need to update this according to your Source0
rm src/test/jars/plexus-utils-1.4.1.jar
ln -s $(build-classpath plexus/utils) src/test/jars/plexus-utils-1.4.1.jar

mvn-helper replace -r /usr/share/maven2/bootstrap_repo/mvn-pass1/ .
mvn-helper filter -f /etc/mvn-helper/config.xml .

export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
# we skip test because even with binary mvn release these fail for
# various reasons.
# mvn-jpp -e \
#         -Dmaven2.jpp.mode=true \
#         -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
#         -Dmaven2.jpp.depmap.file="%{SOURCE1}" \
#         install javadoc:javadoc

mvn --settings /usr/share/maven2/conf/settings-custom.xml -Dmaven.test.skip=true install


# jars
install -Dpm 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)

# poms
install -Dpm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom

%add_to_maven_depmap org.apache.maven.plugins %{name} %{version} JPP %{name}

# javadoc
# install -dm 755 %{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*



rm -rf %{buildroot}


# %files javadoc
# %defattr(-,root,root,-)
# %{_javadocdir}/%{name}-%{version}
# %{_javadocdir}/%{name}

* Thu Jul  8 2010 Stanislav Ochotnicky <> - 1.3.3-2
- Replace plexus utils jar with symlink
- Create MAVEN_REPO_LOCAL dir before calling maven

* Tue Jun 22 2010 Stanislav Ochotnicky <> - 1.3.3-1
- Initial package