mvn-hpi-plugin

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

mvn-hpi-plugin

Eric Crahen-3
I'm attempting to bundle some freely distributable third-party libraries in an HPI file. My plugin needs to build against these third-party libraries as well as against the Hudson API. The third-party libraries don't have pom's on any public maven repository, and I wouldn't want to distribute them separately anyways. According to the HPI layout in the docs, WEB-INF/lib can be used to store libraries, and they will end up in the classpath. This is perfect for what I want to do, distribution-wise.

My question revolves around the maven project for my plugin. I'm able to construct an HPI containing a WEB-INF/lib if I put files in my src/main/webapp/WEB-INF/lib directory. However, "mvn compile" doesn't ever include these libraries in the build path. There doesn't appear to be a way to make the maven-compiler-plugin to take in auxillarly classpaths. I typically use ant, I don't have much background with maven so I can't really make a good guess as to what I need to do in order to include some jars in a maven project that my code can compile against. I also don't know the right way to get the hpi plugin to put this stuff into the plugin archive.

Any advice would be appriciated. Thanks,

--
- Eric
Reply | Threaded
Open this post in threaded view
|

Re: mvn-hpi-plugin

Kohsuke Kawaguchi-2
Eric Crahen wrote:

> I'm attempting to bundle some freely distributable third-party libraries in
> an HPI file. My plugin needs to build against these third-party libraries as
> well as against the Hudson API. The third-party libraries don't have pom's
> on any public maven repository, and I wouldn't want to distribute them
> separately anyways. According to the HPI layout in the docs, WEB-INF/lib can
> be used to store libraries, and they will end up in the classpath. This is
> perfect for what I want to do, distribution-wise.
>
> My question revolves around the maven project for my plugin. I'm able to
> construct an HPI containing a WEB-INF/lib if I put files in my
> src/main/webapp/WEB-INF/lib directory. However, "mvn compile" doesn't ever
> include these libraries in the build path. There doesn't appear to be a way
> to make the maven-compiler-plugin to take in auxillarly classpaths. I
> typically use ant, I don't have much background with maven so I can't really
> make a good guess as to what I need to do in order to include some jars in a
> maven project that my code can compile against. I also don't know the right
> way to get the hpi plugin to put this stuff into the plugin archive.
>
> Any advice would be appriciated. Thanks,
The way it works in Maven is that you have to tell those 3rd party
dependencies to Maven by listing them as <dependency>s in your pom.xml.
If you look at some of the existing plugins, you can see examples.

When maven invokes javac, it recognizes those dependencies and specifies
them as classpath. When the hpi plugin creates an hpi bundle, it bundles
all the dependencies to the WEB-INF/lib.

So the step you need to take to make this work is to create a small
"local repository" that hosts those 3rd party jar. Take a look at jprt
plugin in Hudson CVS. It does just that in its lib/ directory.

Was there any progress in getting approval to host your plugins on
hudson.dev.java.net? I'm more than happy to help you with those things
by making changes myself, and it's much easier to do so when we have the
source code on CVS.

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: mvn-hpi-plugin

Eric Crahen-3
I still have to wait for sign off from the VP. Getting my organization involved in open source projects is a relatively new thing so we have a bunch of red tape to go through. I will definitely  upload stuff ASAP.

On 2/6/07, Kohsuke Kawaguchi <[hidden email]> wrote:
Eric Crahen wrote:

> I'm attempting to bundle some freely distributable third-party libraries in
> an HPI file. My plugin needs to build against these third-party libraries as
> well as against the Hudson API. The third-party libraries don't have pom's
> on any public maven repository, and I wouldn't want to distribute them
> separately anyways. According to the HPI layout in the docs, WEB-INF/lib can
> be used to store libraries, and they will end up in the classpath. This is
> perfect for what I want to do, distribution-wise.
>
> My question revolves around the maven project for my plugin. I'm able to
> construct an HPI containing a WEB-INF/lib if I put files in my
> src/main/webapp/WEB-INF/lib directory. However, "mvn compile" doesn't ever
> include these libraries in the build path. There doesn't appear to be a way
> to make the maven-compiler-plugin to take in auxillarly classpaths. I
> typically use ant, I don't have much background with maven so I can't really
> make a good guess as to what I need to do in order to include some jars in a
> maven project that my code can compile against. I also don't know the right
> way to get the hpi plugin to put this stuff into the plugin archive.
>
> Any advice would be appriciated. Thanks,

The way it works in Maven is that you have to tell those 3rd party
dependencies to Maven by listing them as <dependency>s in your pom.xml.
If you look at some of the existing plugins, you can see examples.

When maven invokes javac, it recognizes those dependencies and specifies
them as classpath. When the hpi plugin creates an hpi bundle, it bundles
all the dependencies to the WEB-INF/lib.

So the step you need to take to make this work is to create a small
"local repository" that hosts those 3rd party jar. Take a look at jprt
plugin in Hudson CVS. It does just that in its lib/ directory.

Was there any progress in getting approval to host your plugins on
hudson.dev.java.net? I'm more than happy to help you with those things
by making changes myself, and it's much easier to do so when we have the
source code on CVS.

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]




--

- Eric
Reply | Threaded
Open this post in threaded view
|

Re: mvn-hpi-plugin

Eric Crahen-3
In reply to this post by Kohsuke Kawaguchi-2
This worked perfectly. Thanks.

On 2/6/07, Kohsuke Kawaguchi <[hidden email]> wrote:
So the step you need to take to make this work is to create a small
"local repository" that hosts those 3rd party jar. Take a look at jprt
plugin in Hudson CVS. It does just that in its lib/ directory.

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]




--

- Eric