Showing posts with label Maven. Show all posts
Showing posts with label Maven. Show all posts

Tuesday, April 19, 2011

Maven and RPM - one problem less

Are you packaging Java software?

Does your package use Maven as a build system?

Have you wondered what package provides certain Maven artifact?

If you answered yes to at least one of the questions there is a good news for you:

Fedora's build system is going to automatically generate RPM Provides in a sensible way for Maven developers.

Now the details. Big thanks goes to the RPM developers for the new Dependency Generator which has made our work so much easier.

With just these 2 simple files maven.attr and maven.provwe get it to the state where every package that installs pom files according to Fedora Java Packaging Guidelineswill get provides added for every pom installed in the form mvn(groupId:artifactId)where groupId and artifactId are the same things you know from your Maven experience. Look at this recent maven2 rebuildfor example what will be generated for a package with many pom files installed.

It might look a small thing but I'm really looking for the day when I'll be able to write BuildRequires: mvn(org.apache.maven:maven-script-ant) and not having to guess whether this is part of maven package or maven-plugin-tools-ant or maven-shared-ant. And these days are near for rawhide when we get the critical mass of rebuilds done so the provides are in place.

This opens an enourmous opportunity for improving a number of things like:

* when you get a build failure in your maven build - you should be able to just write yum install mvn(groupId:artifactId) and have the package ready. Who knows we might even find someone to create a PackageKit extension in the way bash command-not-found is acting?

* tools like RPMStubby will be able to generate proper BuildRequires section without guessing how did the distribution renamed the package

* use your imagination

There is a possibility to add similar support for the requires generation but lets first do all the fixes/simplification this one gives us.

Happy packaging to all Java and Maven packagers!!!

Wednesday, March 16, 2011

Rpm distros unite (at least their Java stacks)

As an Eclipse developer I'm really proud to say that Eclipse happens to be the driving force for improving the Java stack in various Linux RPM distros. Kudos to all Eclipse developers for making the platform that happens to be the single Java based application that Linux packagers are willing to spend time getting it shipped with their distro!!!

Eclipse dependencies are build using the two most popular Java build systems - Ant and Maven. And that's how the whole work on getting their latest versions packaged to work properly on Fedora. A number of other people joined the effort and we wouldn't have made it without their great help. So what we have now is Maven 3.0.3 on the upstream release date (thanks to the hard work done by Stanislav Ochotnický) - hey this is the first time EVER! Mageia and openSUSE are also working hard to get their stacks updated to the state of Fedora one.

Cross-distros collaboration happens in the best possible way - dev-to-dev directly on #fedora-java or #eclipse-linux at irc.freenode.org . Let me put a small cite to show it:


[08:33] <akurtakov> sshaw: did you fix the icu4j
[08:34] <sshaw> akurtakov: yeah
[08:34] <sshaw> well dmorgan did
[08:34] <sshaw> he finished it up for me when I fell asleep
[08:34] <sshaw> akurtakov: with + sed -i -e 's|tomcat5-jsp-2.0-api|tomcat6-jsp-2.1-api|g' dependencies.properties
[08:34] <sshaw> can I drop tomcat 5?
[08:34] <akurtakov> heh, crossdistro collaboration to the rescue
[08:34] <sshaw> akurtakov: rpm distros unite

Disclaimer:

  • Fedora - akurtakov - Alexander Kurtakov
  • openSUSE - sshaw - Stephen Shaw
  • Mageia - dmorgan - Dexter Morgan

As I have started with Eclipse and it's role - Mageia already has Eclipse and OpenSuse is really close to getting it packaged. All of this is of course based on the Eclipse Linux Tools eclipse-build project (there is Debian and Ubuntu helping there) but the RPM distros have gone one step further - even the RPM specfile is kind of a shared one.

When Andrew Overholt pointed me into starting eclipse-build I have never thought that this project will happen to be a hub for real cross-distro collaboration bigger than it's Eclipse influence. There are a number of other nice chats/ideas for collaboration that happened thanks to the personal talks that started around eclipse-build. Thanks to Niels Thykier who told us about Debian work for creating Java webapps packaging guidelines and helper tools this was brought to Fedora Java SIG meetings for discussion. There is no fruit from this discussion yet but at least we are trying to be aware of each other's work so we(all Linux distros) can come with a single position that can influence upstream Java developers - note that they are not mandatory Linux developers so they are not aware of our problems.

Collaboration is not something that can be pushed to people top-down in the FOSS world, it depends on every single contributor to make it happen bottom-up. And it is already happening you have to just join us.

Tuesday, September 8, 2009

Packaging Java libraries using Maven build system

After the BIG fight for updating Maven in Fedora (yay we got version 2.0.8 in Rawhide, finally) a really nice idea came to me: enhance RPMStubby to work for Maven pom.xml files in addition to Eclipse feature.xml files.
It happen to be really easy. Try it out from Linux Tools nightly update site and don't forget to report bugs.

Quick HOW-TO:
  • Right click on your pom.xml file.
  • Select Stubby/Stubbify a RPM spec file.
  • Enjoy.
Note: Upstream developers using Maven build system please fill all the metadata supposed to be in the pom.xml file. You will help us by not having to open bug reports like this.