Re: Trouble building maven plugin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On Tuesday 27 April 2010, Orion Poplawski wrote:
> I'm trying to build the buildnumber maven plugin with the attached spec
> but getting:
> 
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] 'install' was specified in an execution, but not found in the plugin
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: 'install' was
> specified in an execution, but not found in the plugin
>          at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.bindExecutionToLifecycl
> e(DefaultLifecycleExecutor.java:1342)
> 
> Any ideas?  Thanks!

Hi Orion,
This is easily fixed by removing goal install from the integration-test 
execution (line 209). But there is also a problem with your Source0, it's not 
in the standard maven build structure and the pom will not find the sources.

The attached spec file gets further in the build but it end complaining about 
missing artifacts:
1) com.google.code.maven-scm-provider-svnjava:maven-scm-provider-
svnjava:jar:1.8  
2) org.tmatesoft.svnkit:svnkit:jar:1.3.1-1
3) net.java.dev.jna:jna:jar:3.2.2 

You can easily fix the last two with a local depmap or fix them the proper way 
by making svnkit and jna install depmap and pom.

P.S. I've intentionally named the tarball and changed the  %setup call to be 
sure that you will get a proper sources.

Good luck,
Alex
Name:           buildnumber-maven-plugin
Version:        1.0
Release:        0.1.beta4%{?dist}
Epoch:          0
Summary:        Buildnumber Maven plugin
License:        MIT
Group:          Development/Java
URL:            http://mojo.codehaus.org/buildnumber-maven-plugin
#svn export https://svn.codehaus.org/mojo/tags/buildnumber-maven-plugin-1.0-beta-4 buildnumber-maven-plugin
#tar caf buildnumber-maven-plugin.tar.xz buildnumber-maven-plugin/
Source0:        buildnumber-maven-plugin.tar.xz

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch:      noarch

BuildRequires:  jpackage-utils >= 0:1.7.2
BuildRequires:  maven2 >= 2.0.4
BuildRequires:  maven2-plugin-changes
BuildRequires:  maven2-plugin-compiler
BuildRequires:  maven2-plugin-enforcer
BuildRequires:  maven2-plugin-invoker
BuildRequires:  maven2-plugin-install
BuildRequires:  maven2-plugin-jar
BuildRequires:  maven2-plugin-javadoc
BuildRequires:  maven2-plugin-plugin
BuildRequires:  maven2-plugin-resources
BuildRequires:  maven2-plugin-surefire
BuildRequires:  maven-plugin-cobertura

Requires:       maven2 >= 2.0.4

Requires(post):    jpackage-utils >= 0:1.7.2
Requires(postun):  jpackage-utils >= 0:1.7.2

%description
This mojo is designed to get a unique build number for each time you build your project. So while your version may remain constant at 1.0-SNAPSHOT for many iterations until release, you will have a build number that can uniquely identify each build during that time. The build number is obtained from scm, and in particular, at this time, from svn. You can then place that build number in metadata, which can be accessed from your app, if desired.

The mojo also has a couple of extra functions to ensure you get the proper build number. First, your local repository is checked to make sure it is up to date. Second, your local repository is automatically updated, so that you get the latest build number. Both these functions can be suppressed, if desired.

Optionally, you can configure this mojo to produce a revision based on a timestamp, or on a sequence, without requiring any interaction with an SCM system. Note that currently, the only supported SCM is subversion.

%package javadoc
Summary:        Javadoc for %{name}
Group:          Development/Documentation

%description javadoc
Javadoc for %{name}.

%prep
%setup -q -n %{name}

sed -i -e "s|<goal>install</goal>||g" pom.xml

%build
export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
mkdir -p $MAVEN_REPO_LOCAL

mvn-jpp \
        -e \
        -Dmaven.repo.local=$MAVEN_REPO_LOCAL \
        install javadoc:javadoc

%install
rm -rf $RPM_BUILD_ROOT
# jars
install -d -m 755 $RPM_BUILD_ROOT%{_javadir}/buildnumber
install -pm 644 target/*.jar \
        $RPM_BUILD_ROOT%{_javadir}/buildnumber/%{subname}-%{version}.jar
%add_to_maven_depmap org.codehaus.mojo %{name} 1.0 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

# 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

%post
%update_maven_depmap

%postun
%update_maven_depmap

%files
%defattr(-,root,root,-)
%{_javadir}/buildnumber
%{_datadir}/maven2
%{_mavendepmapfragdir}

%files javadoc
%defattr(-,root,root,-)
%doc %{_javadocdir}/*

%changelog
--
java-devel mailing list
java-devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/java-devel

[Index of Archives]     [Red Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux