You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Van Steenberghe Mario (GFDI)" <Ma...@gfdi.be> on 2005/08/19 10:46:30 UTC

[m2] plugin classpath question

Hello,

Is there anyone who knows how the classpath is defined when a maven2 plug-in is run ? 

I expected that all the dependent jars, defined in my POM should be on the classpath, but when I print out the classpath inside my plug-in, I get:

/**
 * @see org.apache.maven.reporting.AbstractMavenReport#executeReport(java.util.Locale)
 */
  
public void executeReport(final Locale locale) throws MavenReportException {
  ...
  getLog().info("  - classpath   : " + System.getProperty("java.class.path"));
  ...
}

output:

  - classpath   : /opt/maven2-SNAPSHOT/core/boot/classworlds-1.1-alpha-2.jar


Thanks,
Mario.

Re: [m2] plugin classpath question

Posted by Brett Porter <br...@gmail.com>.
The plugin gets the plugin's dependencies, not the project's.

Also, it uses a separate class loader, so the system classpath only
reflects what was used to bootstrap Maven (classworlds).

You can get the JARs for the project's artifacts using the
${project.artifacts} expression.

- Brett

On 8/19/05, Van Steenberghe Mario (GFDI) <Ma...@gfdi.be> wrote:
> Hello,
> 
> Is there anyone who knows how the classpath is defined when a maven2 plug-in is run ?
> 
> I expected that all the dependent jars, defined in my POM should be on the classpath, but when I print out the classpath inside my plug-in, I get:
> 
> /**
>  * @see org.apache.maven.reporting.AbstractMavenReport#executeReport(java.util.Locale)
>  */
> 
> public void executeReport(final Locale locale) throws MavenReportException {
>   ...
>   getLog().info("  - classpath   : " + System.getProperty("java.class.path"));
>   ...
> }
> 
> output:
> 
>   - classpath   : /opt/maven2-SNAPSHOT/core/boot/classworlds-1.1-alpha-2.jar
> 
> 
> Thanks,
> Mario.
> 
>

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