From Fedora Project Wiki
(Removed Group tag from spec examples (deprecated since Fedora 17))
 
(16 intermediate revisions by 3 users not shown)
Line 6: Line 6:


== Owner ==
== Owner ==
* Name: [[StanislavOchotnicky]]
* Name: [[User:Sochotni|Stanislav Ochotnicky]]
* Email: sochotnicky@redhat.com
* Email: sochotnicky@redhat.com


== Current status ==
== Current status ==
* Targeted release: [[Releases/19| Fedora 19]]
* Targeted release: [[Releases/19|Fedora 19]]
* Last updated: 2013-01-24
* Last updated: 2013-05-09
* Percentage of completion: 50%
* Percentage of completion: 100%


== Detailed Description ==
== Detailed Description ==
Line 21: Line 21:
* Automatic requires generation for Maven artifacts
* Automatic requires generation for Maven artifacts


Goal of this feature is to migrate all packages to use XMvn instead of mvn-rpmbuild script.
Goal of this feature is to migrate all packages to use XMvn instead of mvn-rpmbuild script. Several packages have already been converted as part of initial testing:
* http://pkgs.fedoraproject.org/cgit/maven-surefire.git/tree/maven-surefire.spec
* http://pkgs.fedoraproject.org/cgit/maven-doxia.git/tree/maven-doxia.spec
* http://pkgs.fedoraproject.org/cgit/slf4j.git/tree/slf4j.spec
* http://pkgs.fedoraproject.org/cgit/apache-commons-compress.git/tree/apache-commons-compress.spec
 
Most simple form of new Maven spec file would like something like this:
<pre>
Name:          XXX
Version:        XXX
Release:        1%{?dist}
Summary:        XXX
License:        XXX
URL:            XXX
Source0:        XXX
BuildArch:      noarch
 
BuildRequires:  maven-local
BuildRequires:  XXX
 
%description
XXX
 
%package javadoc
Summary:        API documentation for %{name}
 
%description javadoc
This package provides %{summary}.
 
%prep
%setup -q
 
%build
%mvn_build
 
%install
%mvn_install
 
%files -f .mfiles
%doc README
%doc LICENSE NOTICE
%dir %{_javadir}/%{name}
 
%files javadoc -f .mfiles-javadoc
%doc LICENSE NOTICE
 
%changelog
* Wed Jan 23 2013 Mr Packager <root@localhost> - XXX-1
- Initial packaging
</pre>


== Benefit to Fedora ==
== Benefit to Fedora ==


After moving packages to start using XMvn instead of current mvn-rpmbuild spec files will be more simple, easier to maintain and modify. Automatic requires generation will make updating packages easier and less error-prone.
After moving packages to start using XMvn instead of current mvn-rpmbuild spec files will be simpler, easier to maintain and modify. Automatic requires generation will make updating packages easier and less error-prone.


Not having to patch Maven will also open door to faster Maven updates.
Not having to patch Maven will also open door to faster Maven updates.
Line 52: Line 101:
== Contingency Plan ==
== Contingency Plan ==


* No contingency plan, packages that can not migrate due to inevitable incompatibilities can keep using mvn-rpmbuild and ignore automatic requires.  
* In case some packages can not migrate due to inevitable incompatibilities they can keep using mvn-rpmbuild and ignore automatic requires.  


== Documentation ==
== Documentation ==


Recipes for conversion from old mvn-rpmbuild to XMvn are being prepared[http://sochotni.fedorapeople.org/xmvn-cookbook/recipe1.html].
Recipes for conversion from old mvn-rpmbuild to XMvn are being prepared [http://mizdebsk.fedorapeople.org/xmvn/cookbook/].


== Release Notes ==
== Release Notes ==


No need for a release notes entry.
Improved and simplified way to create RPM packages out of Apache Maven projects has been introduced. See documentation for conversion recipes from old spec files.


== Comments and Discussion ==
== Comments and Discussion ==
Line 67: Line 116:




[[Category:FeaturePageIncomplete]]
[[Category:FeatureAcceptedF19]]
<!--[[Category:FeatureReadyForFesco]]-->
<!--[[Category:FeatureReadyForFesco]]-->
<!-- When your feature page is completed and ready for review -->
<!-- When your feature page is completed and ready for review -->

Latest revision as of 19:37, 7 November 2013

Simplify Java/Maven Packaging using XMvn

Summary

Introduce new Maven packaging tooling with new macros, automated install section and more

Owner

Current status

  • Targeted release: Fedora 19
  • Last updated: 2013-05-09
  • Percentage of completion: 100%

Detailed Description

Current Maven packaging can be time-consuming and full of repetition even for simple packages. To simplify Maven packaging new XMvn tools and macros have been developed. Main features of XMvn include:

  • No need for patched Maven (simpler maintenance)
  • Automated %install section with possible per-artifact installation configuration
  • Automatic requires generation for Maven artifacts

Goal of this feature is to migrate all packages to use XMvn instead of mvn-rpmbuild script. Several packages have already been converted as part of initial testing:

Most simple form of new Maven spec file would like something like this:

Name:           XXX
Version:        XXX
Release:        1%{?dist}
Summary:        XXX
License:        XXX
URL:            XXX
Source0:        XXX
BuildArch:      noarch

BuildRequires:  maven-local
BuildRequires:  XXX

%description
XXX

%package javadoc
Summary:        API documentation for %{name}

%description javadoc
This package provides %{summary}.

%prep
%setup -q

%build
%mvn_build

%install
%mvn_install

%files -f .mfiles
%doc README
%doc LICENSE NOTICE
%dir %{_javadir}/%{name}

%files javadoc -f .mfiles-javadoc
%doc LICENSE NOTICE

%changelog
* Wed Jan 23 2013 Mr Packager <root@localhost> - XXX-1
- Initial packaging

Benefit to Fedora

After moving packages to start using XMvn instead of current mvn-rpmbuild spec files will be simpler, easier to maintain and modify. Automatic requires generation will make updating packages easier and less error-prone.

Not having to patch Maven will also open door to faster Maven updates.

Scope

Conversion of mvn-rpmbuild spec files to XMvn is mostly trivial removals and simplifications, but we'll be providing recipes for most common conversions.

How To Test

Tests are best done by reworking your packages to use XMvn instead of mvn-rpmbuild and then verify that automatically generated requires stayed sane.

User Experience

End-users:

  • No end-user visible difference

Packagers:

  • Packagers will likely enjoy simplified spec files
  • Packagers will nevertheless have to learn new ways to handle Maven packaging. Advantages outweigh this learning curve though.

Dependencies

  • No dependencies

Contingency Plan

  • In case some packages can not migrate due to inevitable incompatibilities they can keep using mvn-rpmbuild and ignore automatic requires.

Documentation

Recipes for conversion from old mvn-rpmbuild to XMvn are being prepared [1].

Release Notes

Improved and simplified way to create RPM packages out of Apache Maven projects has been introduced. See documentation for conversion recipes from old spec files.

Comments and Discussion