Hi,

I am new to Maven and currently want to write a custom java plugin, my
workspace is something like below:

template:common   --- a project to store utility class and method
template:maven-buildarchetype-plugin   --- Test writing java mojo plugin

, where their file structure is something like this:

[template:Common]  
   |_ 
   |   src/main/java/
   |                |___ 
   |                      
http://www.nabble.com/user-files/62/XMLPathHelper.java XMLPathHelper.java 
   |_ 
   |   src/test/java/
   |                |___  ...
   |                         
http://www.nabble.com/user-files/63/XMLPathHelperTest.java
XMLPathHelperTest.java  
   |                         ...
   |_ 
        http://www.nabble.com/user-files/61/pom.xml pom.xml 

[template:myplugintest]  
   |_ 
   |   src/main/java/
   |                |___  http://www.nabble.com/user-files/64/Archetype.java
Archetype.java  
   |_ 
        http://www.nabble.com/user-files/66/pom.xml pom.xml 

I then use "mvn install" first in "Common" project then "myplugintest". But
my problem is that XMLPathHelperTest works in the "Common", but not
"myplugintest".
I suspect the problem is the related to classloader that:

   (1) "XMLPathHelperTest" use "org.jdom.xpath.XPath"
   (2) "org.jdom.xpath.XPath" call "java.lang.Class.forName" to dynamic load
some class in "saxpath library" (propably XPath's  "selectNode" method)
   (3) but the classloader is different in the plugin project 

So my question is how to pass the correct maven dependency classloader to
the plugin "test" flow?

Thanks,
RoySiu


-- 
View this message in context: 
http://www.nabble.com/Problem-on-java-plugin-development-%28fail-to-use-dependency-classpath%29-tf1978606.html#a5428888
Sent from the Maven - Users forum at Nabble.com.


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

Reply via email to