You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Florian Traverse <fl...@gmail.com> on 2007/08/20 11:34:49 UTC
Maven plugin using ant
Hi guys,
and sorry if it's not the good mailing list(may be the user list would be
more appropriate, but it's a maven plugin development so ...).
I would like to extend Maven with a JSDoc Toolkit plugin in order to
document some big javascript projects.
To do this I just have to : launch the Rhino JAR with a javascript embedded
in the plugin and configure some options (
http://code.google.com/p/jsdoc-toolkit/wiki/CmdlineOptions )
So I have decided to use the ant plugin approach : I followed this tutorial
http://maven.apache.org/guides/plugin/guide-ant-plugin-development.html then
tried to do 2 things:
- use the rhino.jar as a dependence of my plugin, and I refer it through the
localrepository variable ${settings.localRepository} (I haven't found any
other way to do it :'( ). It's ok but it's not a good way to do this ( <java
jar="${localRepository}\rhino\js\1.6R5\js-1.6R5.jar" ... )
- call with the jar my app/run.js which is in my plugin resources
(src/main/resources). I cannot find any accessible variable to do this :'(
Yes this plugin should be very simple to create... but ... there is a real
lack of documentation on how to acces differente critical resources (plugin
dependencies, plugin resources)
Tried this ones :
http://docs.codehaus.org/display/MAVENUSER/MavenPropertiesGuide
and those too:
http://maven.apache.org/plugins/maven-antrun-plugin/examples/classpaths.html
Could someone help me ?
Regards,
Florian Traverse,
a desperate developpe...
Re: Maven plugin using ant
Posted by Florian Traverse <fl...@gmail.com>.
I'll contact you if I can develop such a plugin (with a time dedicated
to develop it, and giving it to everyone as open source program).
Thanks for help,
Florian
2007/8/21, Stephane Nicoll <st...@gmail.com>:
> Hi Florian,
>
> At work, we do have the need to use JSDoc and we were about to
> implement a plugin ourself. If you need help or test, please let me
> know so that I can see how we can do that.
>
> Regards,
> Stéphane
>
> On 8/20/07, Florian Traverse <fl...@gmail.com> wrote:
> > Hi guys,
> > and sorry if it's not the good mailing list(may be the user list would be
> > more appropriate, but it's a maven plugin development so ...).
> >
> > I would like to extend Maven with a JSDoc Toolkit plugin in order to
> > document some big javascript projects.
> > To do this I just have to : launch the Rhino JAR with a javascript embedded
> > in the plugin and configure some options (
> > http://code.google.com/p/jsdoc-toolkit/wiki/CmdlineOptions )
> >
> > So I have decided to use the ant plugin approach : I followed this tutorial
> > http://maven.apache.org/guides/plugin/guide-ant-plugin-development.html then
> > tried to do 2 things:
> >
> > - use the rhino.jar as a dependence of my plugin, and I refer it through the
> > localrepository variable ${settings.localRepository} (I haven't found any
> > other way to do it :'( ). It's ok but it's not a good way to do this ( <java
> > jar="${localRepository}\rhino\js\1.6R5\js-1.6R5.jar" ... )
> >
> > - call with the jar my app/run.js which is in my plugin resources
> > (src/main/resources). I cannot find any accessible variable to do this :'(
> >
> >
> > Yes this plugin should be very simple to create... but ... there is a real
> > lack of documentation on how to acces differente critical resources (plugin
> > dependencies, plugin resources)
> >
> > Tried this ones :
> > http://docs.codehaus.org/display/MAVENUSER/MavenPropertiesGuide
> > and those too:
> > http://maven.apache.org/plugins/maven-antrun-plugin/examples/classpaths.html
> >
> > Could someone help me ?
> >
> > Regards,
> >
> >
> > Florian Traverse,
> > a desperate developpe...
> >
>
>
> --
> Large Systems Suck: This rule is 100% transitive. If you build one,
> you suck" -- S.Yegge
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Maven plugin using ant
Posted by Stephane Nicoll <st...@gmail.com>.
Hi Florian,
At work, we do have the need to use JSDoc and we were about to
implement a plugin ourself. If you need help or test, please let me
know so that I can see how we can do that.
Regards,
Stéphane
On 8/20/07, Florian Traverse <fl...@gmail.com> wrote:
> Hi guys,
> and sorry if it's not the good mailing list(may be the user list would be
> more appropriate, but it's a maven plugin development so ...).
>
> I would like to extend Maven with a JSDoc Toolkit plugin in order to
> document some big javascript projects.
> To do this I just have to : launch the Rhino JAR with a javascript embedded
> in the plugin and configure some options (
> http://code.google.com/p/jsdoc-toolkit/wiki/CmdlineOptions )
>
> So I have decided to use the ant plugin approach : I followed this tutorial
> http://maven.apache.org/guides/plugin/guide-ant-plugin-development.html then
> tried to do 2 things:
>
> - use the rhino.jar as a dependence of my plugin, and I refer it through the
> localrepository variable ${settings.localRepository} (I haven't found any
> other way to do it :'( ). It's ok but it's not a good way to do this ( <java
> jar="${localRepository}\rhino\js\1.6R5\js-1.6R5.jar" ... )
>
> - call with the jar my app/run.js which is in my plugin resources
> (src/main/resources). I cannot find any accessible variable to do this :'(
>
>
> Yes this plugin should be very simple to create... but ... there is a real
> lack of documentation on how to acces differente critical resources (plugin
> dependencies, plugin resources)
>
> Tried this ones :
> http://docs.codehaus.org/display/MAVENUSER/MavenPropertiesGuide
> and those too:
> http://maven.apache.org/plugins/maven-antrun-plugin/examples/classpaths.html
>
> Could someone help me ?
>
> Regards,
>
>
> Florian Traverse,
> a desperate developpe...
>
--
Large Systems Suck: This rule is 100% transitive. If you build one,
you suck" -- S.Yegge
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Maven plugin using ant
Posted by Florian Traverse <fl...@gmail.com>.
I think my question wasn't clear, (or I haven't understood your
answer), I have no time right now to look at this plugin.
So thank you, I'll ask my questions more precisely in some time.
I may develop this plugin in another project and I may release it
under an opensource license (
we have some open source projects in our company so this could be one :) )
Sorry, and thanks for help!
2007/8/20, Timothy Reilly <tr...@prolifics.com>:
> Florian, let me know if this example pom helps?
>
> This pom
> ================
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0 <http://maven.apache.org/POM/4.0.0> "
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance <http://www.w3.org/2001/XMLSchema-instance> "
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 <http://maven.apache.org/POM/4.0.0>
> http://maven.apache.org/maven-v4_0_0.xsd <http://maven.apache.org/maven-v4_0_0.xsd> ">
> <modelVersion>4.0.0</modelVersion>
> <groupId>maven-scratch</groupId>
> <artifactId>maven-scratch</artifactId>
> <packaging>pom</packaging>
> <version>0.0.1</version>
>
> <build>
> <plugins>
> <plugin>
>
> <groupId>org.apache.maven.plugins</groupId>
>
> <artifactId>maven-antrun-plugin</artifactId>
> <executions>
> <execution>
> <id>foobar</id>
> <phase>validate</phase>
> <configuration>
> <tasks>
>
> <property name="compile_classpath" refid="maven.compile.classpath" />
> <property name="runtime_classpath" refid="maven.runtime.classpath" />
> <property name="test_classpath" refid="maven.test.classpath" />
> <property name="plugin_classpath" refid="maven.plugin.classpath" />
>
> <script language="javascript">
> <![CDATA[
> echo = project.createTask("echo");
> echo.setMessage(compile_classpath);
> echo.perform();
>
> echo = project.createTask("echo");
> echo.setMessage(runtime_classpath);
> echo.perform();
>
> echo = project.createTask("echo");
> echo.setMessage(test_classpath);
> echo.perform();
>
> echo = project.createTask("echo");
> echo.setMessage(plugin_classpath);
> echo.perform();
> ]]>
>
> </script>
>
> </tasks>
> </configuration>
> <goals>
> <goal>run</goal>
> </goals>
> </execution>
>
> </executions>
> <dependencies>
> <dependency>
> <groupId>ant</groupId>
>
> <artifactId>ant-apache-bsf</artifactId>
> <version>1.6.5</version>
> </dependency>
> <dependency>
> <groupId>bsf</groupId>
>
> <artifactId>bsf</artifactId>
> <version>2.4.0</version>
> </dependency>
> <dependency>
> <groupId>rhino</groupId>
>
> <artifactId>js</artifactId>
> <version>1.6R6</version>
> </dependency>
>
> </dependencies>
> </plugin>
> </plugins>
> </build>
> </project>
>
>
> Yields:
> ================
>
> C:\Workspaces\Maven\maven-scratch>mvn validate
> [INFO] Scanning for projects...
> [INFO]
> ------------------------------------------------------------------------
> ----
> [INFO] Building Unnamed - maven-scratch:maven-scratch:pom:0.0.1
> [INFO] task-segment: [validate]
> [INFO]
> ------------------------------------------------------------------------
> ----
> [INFO] [antrun:run {execution: foobar}]
> [echo] C:\Workspaces\Maven\maven-scratch\target\classes
> [echo] C:\Workspaces\Maven\maven-scratch\target\classes
> [echo]
> C:\Workspaces\Maven\maven-scratch\target\classes;C:\Workspaces\Maven\mav
> en-scratch\target\test-classes
> [echo] C:\Documents and
> Settings\ABCXYZ\.m2\repository\ant\ant-launcher\1.6.5\ant-launcher-1.6.5
> .jar;C:\Documents an
> d
> Settings\ABCXYZ\.m2\repository\ant\ant-apache-bsf\1.6.5\ant-apache-bsf-1
> .6.5.jar;C:\Documents and Settings\ABCXYZ\.m2\
> repository\ant\ant\1.6.5\ant-1.6.5.jar;C:\Documents and
> Settings\ABCXYZ\.m2\repository\org\codehaus\plexus\plexus-utils\1
> .1\plexus-utils-1.1.jar;C:\Documents and
> Settings\ABCXYZ\.m2\repository\rhino\js\1.6R6\js-1.6R6.jar;C:\Documents
> and Sett
> ings\ABCXYZ\.m2\repository\org\apache\maven\shared\maven-ant\1.0-SNAPSHO
> T\maven-ant-1.0-SNAPSHOT.jar;C:\Documents and Set
> tings\ABCXYZ\.m2\repository\commons-logging\commons-logging\1.0.4\common
> s-logging-1.0.4.jar;C:\Documents and Settings\CP6
> 5214\.m2\repository\bsf\bsf\2.4.0\bsf-2.4.0.jar;C:\ASF\maven-2.0.7\lib\m
> aven-core-2.0.7-uber.jar
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD SUCCESSFUL
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 3 seconds
> [INFO] Finished at: Mon Aug 20 12:44:10 EDT 2007
> [INFO] Final Memory: 3M/11M
> [INFO]
> ------------------------------------------------------------------------
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
RE: Maven plugin using ant
Posted by Timothy Reilly <tr...@prolifics.com>.
Florian, let me know if this example pom helps?
This pom
================
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0 <http://maven.apache.org/POM/4.0.0> "
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance <http://www.w3.org/2001/XMLSchema-instance> "
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 <http://maven.apache.org/POM/4.0.0>
http://maven.apache.org/maven-v4_0_0.xsd <http://maven.apache.org/maven-v4_0_0.xsd> ">
<modelVersion>4.0.0</modelVersion>
<groupId>maven-scratch</groupId>
<artifactId>maven-scratch</artifactId>
<packaging>pom</packaging>
<version>0.0.1</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>foobar</id>
<phase>validate</phase>
<configuration>
<tasks>
<property name="compile_classpath" refid="maven.compile.classpath" />
<property name="runtime_classpath" refid="maven.runtime.classpath" />
<property name="test_classpath" refid="maven.test.classpath" />
<property name="plugin_classpath" refid="maven.plugin.classpath" />
<script language="javascript">
<![CDATA[
echo = project.createTask("echo");
echo.setMessage(compile_classpath);
echo.perform();
echo = project.createTask("echo");
echo.setMessage(runtime_classpath);
echo.perform();
echo = project.createTask("echo");
echo.setMessage(test_classpath);
echo.perform();
echo = project.createTask("echo");
echo.setMessage(plugin_classpath);
echo.perform();
]]>
</script>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-apache-bsf</artifactId>
<version>1.6.5</version>
</dependency>
<dependency>
<groupId>bsf</groupId>
<artifactId>bsf</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>rhino</groupId>
<artifactId>js</artifactId>
<version>1.6R6</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
Yields:
================
C:\Workspaces\Maven\maven-scratch>mvn validate
[INFO] Scanning for projects...
[INFO]
------------------------------------------------------------------------
----
[INFO] Building Unnamed - maven-scratch:maven-scratch:pom:0.0.1
[INFO] task-segment: [validate]
[INFO]
------------------------------------------------------------------------
----
[INFO] [antrun:run {execution: foobar}]
[echo] C:\Workspaces\Maven\maven-scratch\target\classes
[echo] C:\Workspaces\Maven\maven-scratch\target\classes
[echo]
C:\Workspaces\Maven\maven-scratch\target\classes;C:\Workspaces\Maven\mav
en-scratch\target\test-classes
[echo] C:\Documents and
Settings\ABCXYZ\.m2\repository\ant\ant-launcher\1.6.5\ant-launcher-1.6.5
.jar;C:\Documents an
d
Settings\ABCXYZ\.m2\repository\ant\ant-apache-bsf\1.6.5\ant-apache-bsf-1
.6.5.jar;C:\Documents and Settings\ABCXYZ\.m2\
repository\ant\ant\1.6.5\ant-1.6.5.jar;C:\Documents and
Settings\ABCXYZ\.m2\repository\org\codehaus\plexus\plexus-utils\1
.1\plexus-utils-1.1.jar;C:\Documents and
Settings\ABCXYZ\.m2\repository\rhino\js\1.6R6\js-1.6R6.jar;C:\Documents
and Sett
ings\ABCXYZ\.m2\repository\org\apache\maven\shared\maven-ant\1.0-SNAPSHO
T\maven-ant-1.0-SNAPSHOT.jar;C:\Documents and Set
tings\ABCXYZ\.m2\repository\commons-logging\commons-logging\1.0.4\common
s-logging-1.0.4.jar;C:\Documents and Settings\CP6
5214\.m2\repository\bsf\bsf\2.4.0\bsf-2.4.0.jar;C:\ASF\maven-2.0.7\lib\m
aven-core-2.0.7-uber.jar
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Mon Aug 20 12:44:10 EDT 2007
[INFO] Final Memory: 3M/11M
[INFO]
------------------------------------------------------------------------