You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by TimHedger <Ti...@rbos.com> on 2006/06/28 14:32:30 UTC
Getting the classpath right in a java plugin
I've written a java plugin (for java Visibroker CORBA tasks) but am having
difficulty with the classpath.
I'm getting hold of the classpath using some code I found in the
idlj-maven-plugin:
// Get current class path
URLClassLoader cl = (URLClassLoader)
this.getClass().getClassLoader();
URL[] classPathUrls = cl.getURLs();
And I do indeed get a classpath. However, if in the maven project where I'm
using my plugin, I configure dependencies that themselves add to the
classpath, I'm not getting those dependencies in the classpath as derived
above (and my plugin thus isn't working).
E.g. with this dependency in my build project (which uses my plugin):
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.9</version>
<scope>compile</scope>
</dependency>
I'd expect to get the log4j jar on the classpath, but it's not happening.
How can I access the "final" classpath with all the dependencies added?
--
View this message in context: http://www.nabble.com/Getting-the-classpath-right-in-a-java-plugin-tf1861200.html#a5083389
Sent from the Maven - Users forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Getting the classpath right in a java plugin
Posted by Kieran Brady <ki...@teamcgi.net>.
Oops, my mistake! Don't you just love Outlook Express :)
Viewing the message in text mode doesn't show the link. I wonder what else
I've missed :)
----- Original Message -----
From: "TimHedger" <Ti...@rbos.com>
To: <us...@maven.apache.org>
Sent: Wednesday, June 28, 2006 3:11 PM
Subject: Re: Getting the classpath right in a java plugin
>
> Try clicking on the underlined word thread in my post ! :)
> --
> View this message in context:
> http://www.nabble.com/Getting-the-classpath-right-in-a-java-plugin-tf1861200.html#a5085121
> Sent from the Maven - Users forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Getting the classpath right in a java plugin
Posted by dan tran <da...@gmail.com>.
I think to you can follow surefire-plugin model to implement your
visibroker-maven-plugin. The surefire compent does
most of the work setting up the JVM for you.
-D
On 6/28/06, dan tran <da...@gmail.com> wrote:
>
> take a look at surefire-plugin it has some elegant solution setting up
> classpath/classloader after invoking jvm
>
>
> On 6/28/06, TimHedger <Ti...@rbos.com> wrote:
> >
> >
> > Try clicking on the underlined word thread in my post ! :)
> > --
> > View this message in context:
> > http://www.nabble.com/Getting-the-classpath-right-in-a-java-plugin-tf1861200.html#a5085121
> > Sent from the Maven - Users forum at Nabble.com <http://nabble.com/>.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
Re: Getting the classpath right in a java plugin
Posted by dan tran <da...@gmail.com>.
take a look at surefire-plugin it has some elegant solution setting up
classpath/classloader after invoking jvm
On 6/28/06, TimHedger <Ti...@rbos.com> wrote:
>
>
> Try clicking on the underlined word thread in my post ! :)
> --
> View this message in context:
> http://www.nabble.com/Getting-the-classpath-right-in-a-java-plugin-tf1861200.html#a5085121
> Sent from the Maven - Users forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
Re: Getting the classpath right in a java plugin
Posted by TimHedger <Ti...@rbos.com>.
Try clicking on the underlined word thread in my post ! :)
--
View this message in context: http://www.nabble.com/Getting-the-classpath-right-in-a-java-plugin-tf1861200.html#a5085121
Sent from the Maven - Users forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Getting the classpath right in a java plugin
Posted by Kieran Brady <ki...@teamcgi.net>.
And now you're guilty of not providing a link or other ref for that thread
;-)
----- Original Message -----
From: "TimHedger" <Ti...@rbos.com>
To: <us...@maven.apache.org>
Sent: Wednesday, June 28, 2006 2:59 PM
Subject: Re: Getting the classpath right in a java plugin
>
> I'm guilty of not having searched thoroughly enough before this post -
> apologies.
>
> For others who find this post in search of answers themselves, there is
> another thread in this forum that deals with exactly this issue.
> --
> View this message in context:
> http://www.nabble.com/Getting-the-classpath-right-in-a-java-plugin-tf1861200.html#a5084924
> Sent from the Maven - Users forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Getting the classpath right in a java plugin
Posted by TimHedger <Ti...@rbos.com>.
I'm guilty of not having searched thoroughly enough before this post -
apologies.
For others who find this post in search of answers themselves, there is
another thread in this forum that deals with exactly this issue.
--
View this message in context: http://www.nabble.com/Getting-the-classpath-right-in-a-java-plugin-tf1861200.html#a5084924
Sent from the Maven - Users forum at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org