You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by p Devi <pd...@yahoo.com> on 2005/12/29 17:40:02 UTC

Write maven plugin - Please help

I am currently creating a plugin for exporting 
data from the database using Maven 1.x. To acheive this I use octopus. 
  The directory of the plugin that I create is in C:\Workspace\plugins\spec-config-plugin. I have files Plugin.jelly, plugin.properties, project.xml and folders like src, target, Xdoc in this directory. 
I am able to do the desired task in this directory. But when I run the goal outside of this directory (like c:\temp) I am not able to get the desired output.
 
I get the following error
 
[java] [ERROR] Could not find org.webdocwf.util.loader.Loader. Make sure you have it in your classpath. (Its not able to find the octopus Jar ).
 
I have included the following dependency in the project.xml.
    <dependency>
      <groupId>octopus</groupId>
      <artifactId>octopus</artifactId>
      <version>3.0.1</version>
      <url/>
 <properties>
   <classloader>root</classloader> 
   </properties>
    </dependency>
   I have the following in the plugin.jelly 
   <ant:java classname="org.webdocwf.util.loader.Loader">
      <classpath refid="maven.dependency.classpath"/>
 
If I include the location of the Jar as 
<pathelement path="C:\Workspace\.maven\repository\octopus\jars\octopus-3.0.1.jar"/> it seems to resolve the issue. But I get another exception as it is dependent on another Jar (javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found)
 
 
I have the following in the classpath
MAVEN_HOME=C:\maven\maven-1.1-beta-1
MAVEN_HOME_LOCAL=C:\Workspace\.maven
MAVEN_OPTS=-Xms128M -Xmx256M -Dfile.separ
MAVEN_REPO=C:\Workspace\.maven\repository
and Octopus-3.0.1 is in C:\Workspace\.maven\repository\octopus\jars and org.webdocwf.util.loader.Loader class is present in Octopus-3.0.1
 
My question is how do I specify the classpath of the Jar when I work in C:\Jar. 
Can you please help me to figure out the problem. Please let me know if you need more information.
 
  Thanks,
  Devi


		
---------------------------------
Yahoo! for Good - Make a difference this year. 

Re: Write maven plugin - Please help

Posted by Doug Douglass <dd...@denverdata.com>.
p Devi wrote:

>Thank you very much for the reply.
>   
>  For my goal to work I had to get many dependencies in the plugin.jelly file. I had to import some thing like the following to work as octopus is dependent on many other Jars.
>  <ant:pathelement path="${plugin.getDependencyPath('octopus:octopus')}"/>
>  <ant:pathelement path="${plugin.getDependencyPath('bea:wlsqlserver')}"/>
>  <ant:pathelement path="${plugin.getDependencyPath('bea:wlbase')}"/>
>  <ant:pathelement path="${plugin.getDependencyPath('oracle:ojdbc14')}"/>
>  <ant:pathelement path="${plugin.getDependencyPath('bea:wlutil')}"/>
>  <ant:pathelement path="${plugin.getDependencyPath('octopus:csvjdbc')}"/>
>  <ant:pathelement path="${plugin.getDependencyPath('bea:weblogic')}"/>
>   
>  Is there any way of setting the classpath instead of individually setting it. 
>   
>  I tried some thing like which didn't work
>  <j:forEach var="lib" items="${plugin.artifacts}">
>  <ant:pathelement path="{lib.path}"/>
>   
>  Can you please suggest me other way to set the classpath 
>   
>
>
I just re-read this[1] section of the Developing Plugins page, I think 
item #2 should resolve your problems.

[1] 
http://maven.apache.org/maven-1.x/using/developing-plugins.html#Plugin_dependencies

Doug

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


Re: Write maven plugin - Please help

Posted by p Devi <pd...@yahoo.com>.
Thank you very much for the reply.
   
  For my goal to work I had to get many dependencies in the plugin.jelly file. I had to import some thing like the following to work as octopus is dependent on many other Jars.
  <ant:pathelement path="${plugin.getDependencyPath('octopus:octopus')}"/>
  <ant:pathelement path="${plugin.getDependencyPath('bea:wlsqlserver')}"/>
  <ant:pathelement path="${plugin.getDependencyPath('bea:wlbase')}"/>
  <ant:pathelement path="${plugin.getDependencyPath('oracle:ojdbc14')}"/>
  <ant:pathelement path="${plugin.getDependencyPath('bea:wlutil')}"/>
  <ant:pathelement path="${plugin.getDependencyPath('octopus:csvjdbc')}"/>
  <ant:pathelement path="${plugin.getDependencyPath('bea:weblogic')}"/>
   
  Is there any way of setting the classpath instead of individually setting it. 
   
  I tried some thing like which didn't work
  <j:forEach var="lib" items="${plugin.artifacts}">
  <ant:pathelement path="{lib.path}"/>
   
  Can you please suggest me other way to set the classpath 
   
  Thanks,
  Devi
   
  
Doug Douglass <dd...@denverdata.com> wrote:
  p Devi wrote:

>I am currently creating a plugin for exporting 
>data from the database using Maven 1.x. To acheive this I use octopus. 
> The directory of the plugin that I create is in C:\Workspace\plugins\spec-config-plugin. I have files Plugin.jelly, plugin.properties, project.xml and folders like src, target, Xdoc in this directory. 
>I am able to do the desired task in this directory. But when I run the goal outside of this directory (like c:\temp) I am not able to get the desired output.
> 
>I get the following error
> 
>[java] [ERROR] Could not find org.webdocwf.util.loader.Loader. Make sure you have it in your classpath. (Its not able to find the octopus Jar ).
> 
>I have included the following dependency in the project.xml.
> 
> octopus
> octopus
> 3.0.1
> 
> 

> root 
> 

> 
> I have the following in the plugin.jelly 
> 
> 
> 
>

To resolve the plugin dependency not being found in the classpath try 
changing your classpath element to this:







HTH,
Doug

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

  


		
---------------------------------
Yahoo! for Good - Make a difference this year. 

Re: Write maven plugin - Please help

Posted by Doug Douglass <dd...@denverdata.com>.
p Devi wrote:

>I am currently creating a plugin for exporting 
>data from the database using Maven 1.x. To acheive this I use octopus. 
>  The directory of the plugin that I create is in C:\Workspace\plugins\spec-config-plugin. I have files Plugin.jelly, plugin.properties, project.xml and folders like src, target, Xdoc in this directory. 
>I am able to do the desired task in this directory. But when I run the goal outside of this directory (like c:\temp) I am not able to get the desired output.
> 
>I get the following error
> 
>[java] [ERROR] Could not find org.webdocwf.util.loader.Loader. Make sure you have it in your classpath. (Its not able to find the octopus Jar ).
> 
>I have included the following dependency in the project.xml.
>    <dependency>
>      <groupId>octopus</groupId>
>      <artifactId>octopus</artifactId>
>      <version>3.0.1</version>
>      <url/>
> <properties>
>   <classloader>root</classloader> 
>   </properties>
>    </dependency>
>   I have the following in the plugin.jelly 
>   <ant:java classname="org.webdocwf.util.loader.Loader">
>      <classpath refid="maven.dependency.classpath"/>
>  
>

To resolve the plugin dependency not being found in the classpath try 
changing your classpath element to this:

<ant:classpath>
   <ant:path refid="maven-classpath"/>
   <ant:pathelement path="${plugin.getDependencyPath('octopus:octopus')}"/>
   <ant:path refid="maven.dependency.classpath"/>
</ant:classpath>

HTH,
Doug

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