You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Eric Gwin <er...@oracle.com> on 2013/06/12 20:49:43 UTC

Pointer for non-standard artifact build?

Hi,

I expect this information is available somewhere on the web and in searching for it I've found vast amounts
of highly useful but completely non-relevant (to this problem) information. Therefore I'm sending this email.

Hopefully, you can simply point me in the right direction with a quick example, or an existing reference.

Basically, I'm building a product that ships both as OSGi bundles, and as a legacy jar file. I'm currently
building the individual OSGi bundles with Maven, and then need to jump out to Ant to pull the bundle classes
and resources into the monolithic jar and add a new manifest. I'd like to convert the whole build to Maven,
but am running into a wall trying to figure out how to create a project that needs no source, and packages
with other projects' classes and resources.

A modified life-cycle doesn't seems to really be what I need. Any pointers?

To make matters more complex, because of the mojos I'm using to generate the OSGi bundles, I need to build
standard maven projects inside a separate reactor and since the bundles are basically the foundation for the
rest of the build, I need to run maven first to generate the bundles then invoke another reactor(?) (or
build) to build the non-OSGi components, then assemble the product jar and build the integration test
framework and suites. Any ideas?

-Eric

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Pointer for non-standard artifact build?

Posted by Curtis Rueden <ct...@wisc.edu>.
Hi Eric,

> I'd like to convert the whole build to Maven, but am running into a
> wall trying to figure out how to create a project that needs no
> source, and packages with other projects' classes and resources.

The general approach to creating a JAR-with-dependencies or "uber-jar" is
to use either maven-assembly-plugin or maven-shade-plugin. The latter in
particular offers a few different features relating to this. You can
certainly create a new project, perhaps with <packaging>pom</packaging>,
and with dependencies on all the artifacts you need to be part of the
uber-jar, whose attached artifact is the generated uber-jar with a GAV of
your choice.

Have you explored using one of those? There may be obstacles with e.g.,
synthesizing your uber-jar's manifest, but we won't really be able to offer
much advice here until you try and can describe the specific issues you're
having in more detail first.

Regards,
Curtis