The classpath of project belongs to project, not plugin. While I believe you can create you own ClassLoader based on project.getXXXXXClasspathElements() and find resources from there.

I used to have a small Mojo running something with project's classpath
http://fisheye3.cenqua.com/browse/cyclops-group/trunk/arapaho/arapaho-maven-plugin/src/main/java/com/cyclopsgroup/arapaho/maven/RunJettyMojo.java?r=1738
http://fisheye3.cenqua.com/browse/cyclops-group/trunk/arapaho/arapaho-maven-plugin/src/main/java/com/cyclopsgroup/arapaho/maven/ClassLoaderUtils.java?r=1738

You'll need to find resources with this special ClassLoader, and this classpath won't appear in System.getProperty("java.class.path").

Hope this helps.



Regards
-Jiaqi


Alex Soto wrote:
Hi,

I'm wrapping some existing code in a maven plugin.  What I'd like to
do is make the module's resources available to the plugin.  So for
example, there is a properties file in src/main/resources.  When the
code my plugin wraps looks up the properties file, it should find it
via the classpath.  I've specified a <resources> tag in the module's
<build> section of the pom as such:

       <resources>
           <resource>
               <directory>src/main/resources</directory>
               <filtering>true</filtering>
           </resource>
       </resources>


However, to debug things, I print the classpath in my plugin via
System.getProperty("java.class.path") and the classpath does not
include the target dir or anything else that is in the context of the
module that is executing the plugin.

Anyone have any ideas?

Thanks,
Alex

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--


Jiaqi Guo

http://www.cyclopsgroup.org
[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to