hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Mueller" <dan.in.a.bot...@gmail.com>
Subject publishing sources to the maven-repo
Date Sat, 09 Jun 2007 14:03:40 GMT
Hi folks,

It would be nice if you'd publish the source jars to the maven-repo as well.
This enables IDEs which evaluate the dependencies in a pom to download the
sources for dependencies and you can quickly help fixing bugs or simply
study the code at leisure.

To achieve this you can use the maven-source-plugin[1]. You have basically
three ways to go about it:

   - If you generate the distribution by hand you can simply add an
   additional target when building as described in the maven guide to
   repository uploading[2] (as detailed in step 2 of the guide, eg. 'mvn clean
   source:jar javadoc:jar deploy' (I haven't used repository:bundle-create
   before and it seems it can only be invoked on leaf projects)).
   - If you want to incorporate it into your pom you can copy the
   <profile> section of the first example in [3]. You'd then have to build your
   sources with either -P release-profile (see [4] for more) or
   -DperformRelease at the end of your build command.
   - If you want to be able to do it handsfree, then you can simply add
   the <plugins> section to the project/build element (but this adds time to
   every build, which is at least for the javadoc unnecessary).

If you have an automated build it doesn't matter too much which one you use.

The proposed change makes the build.xml at least partially obsolete. But I
take it you still need it to put together the source distribution for the
apache.org download site and also because the development is easier without
an IDE [5]?

I have only checked httpcomponents-core, but I assume this applies to the
other httpcomponent projects as well. If you change a pom I propose to
change the org.apache.httpcomponents:project pom, because then every
subcomponent inherits the changes. The changes to the build process should
be also for every project.

This post is pretty extensive, but I saw on the mailinglist that at least
Roland didn't like Maven too much a year ago [5]. I don't know if this has
changed, or if I can help with any outstanding issues. I don't consider
myself to be authorative on maven, but I switched recently all projects at
our workplace from ant builds to maven. The projects were large'ish and
included a big hierarchical project with ~50 subcomponents, each built by
its own ant build script. In the end we had practically built our own maven
with ant, which was the point to reconsider. The transition went without
major problems beside the usual 'Doh, how am I gonna solve this one'... I'm
not saying maven solved everything nicely but in the end it was a net-gain.

Thanks and keep up the good work

[1] http://maven.apache.org/plugins/maven-source-plugin/
[2] http://maven.apache.org/guides/mini/guide-central-repository-upload.html
[3] http://maven.apache.org/guides/introduction/introduction-to-the-pom.html

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message