You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Durfee, Bernard" <Be...@suny.edu> on 2005/11/17 20:12:57 UTC

Plugin Classes

I've created a plugin with the following in the plugin.jelly file...

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:ant="jelly:ant">
  <goal name="uportal:update-web-xml" description="Updates the web.xml
for deploying into uPortal">
    <ant:echo message="Invoking Portlet Application Deployment Tool" />

    <ant:taskdef name	= "deployer"
                 classname	=
"org.jasig.portal.container.deploy.DeployerTask"
                 loaderref	= "cc.loader"
                 classpathref	= "maven.dependency.classpath">
    </ant:taskdef>
  
    <deployer webmodule	= "${artifactId}"
              webXML	= "${maven.war.build.dir}/WEB-INF/web.xml"
              portletXML	=
"${maven.war.build.dir}/WEB-INF/portlet.xml"
    </deployer>
  </goal>
</project>

...when I attempt to execute the plugin I get the following error...

BUILD FAILED
File...... C:\Documents and
Settings\durfeebe\.maven\cache\uportal-maven-plugin-0.1\plugin.jelly
Element... ant:taskdef
Line...... 11
Column.... 62
taskdef class org.jasig.portal.container.deploy.DeployerTask cannot be
found

... which I believe is telling me that the ant taskdef tag cannont find
the DeployerTask class. The DeployerTask class is packaged up with the
plugin jar file, which I would assume would be on the classpath in the
plugin! Apparently it is not, how do I reference the classes packaged up
with the Maven plugin jar file?

Thanks,
Bernie


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


RE: Plugin Classes

Posted by Arnaud HERITIER <ah...@gmail.com>.
The problem is that ant needs to find your classes in the root classloader but by default they are in the sub-classloader.
http://maven.apache.org/maven-1.x/using/developing-plugins.html#Plugin_dependencies
A solution is to create another project for your ant task and to define in your plugin a dependency with the root classloader.

I have no other idea.

Arnaud
 

> -----Message d'origine-----
> De : Durfee, Bernard [mailto:Bernard.Durfee@suny.edu] 
> Envoyé : jeudi 17 novembre 2005 20:13
> À : users@maven.apache.org
> Objet : Plugin Classes
> 
> I've created a plugin with the following in the plugin.jelly file...
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns:ant="jelly:ant">
>   <goal name="uportal:update-web-xml" description="Updates 
> the web.xml for deploying into uPortal">
>     <ant:echo message="Invoking Portlet Application 
> Deployment Tool" />
> 
>     <ant:taskdef name	= "deployer"
>                  classname	=
> "org.jasig.portal.container.deploy.DeployerTask"
>                  loaderref	= "cc.loader"
>                  classpathref	= "maven.dependency.classpath">
>     </ant:taskdef>
>   
>     <deployer webmodule	= "${artifactId}"
>               webXML	= "${maven.war.build.dir}/WEB-INF/web.xml"
>               portletXML	=
> "${maven.war.build.dir}/WEB-INF/portlet.xml"
>     </deployer>
>   </goal>
> </project>
> 
> ...when I attempt to execute the plugin I get the following error...
> 
> BUILD FAILED
> File...... C:\Documents and
> Settings\durfeebe\.maven\cache\uportal-maven-plugin-0.1\plugin.jelly
> Element... ant:taskdef
> Line...... 11
> Column.... 62
> taskdef class org.jasig.portal.container.deploy.DeployerTask 
> cannot be found
> 
> ... which I believe is telling me that the ant taskdef tag 
> cannont find the DeployerTask class. The DeployerTask class 
> is packaged up with the plugin jar file, which I would assume 
> would be on the classpath in the plugin! Apparently it is 
> not, how do I reference the classes packaged up with the 
> Maven plugin jar file?
> 
> Thanks,
> Bernie
> 
> 
> ---------------------------------------------------------------------
> 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