You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by youhaodeyi <yo...@gmail.com> on 2008/04/11 07:15:14 UTC

How can I let Maven run a class before packaging

By default, Maven will package all the classes under target/classes directory
into a jar file. But some classes are not generated by compiling, by running
a Java application. How can I let Maven run a java application before
packaging?
-- 
View this message in context: http://www.nabble.com/How-can-I-let-Maven-run-a-class-before-packaging-tp16625144s177p16625144.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


RE: How can I let Maven run a class before packaging

Posted by ni...@planet.nl.
I missed that one, and I think that is the best short term solution. Delicious tagged for future reference. ;)

With regards,

Nick S.


-----Original Message-----
From: Dirk Olmes [mailto:dirk@xanthippe.ping.de]
Sent: Fri 4/11/2008 10:03
To: Maven Users List
Subject: Re: How can I let Maven run a class before packaging
 
nicklist@planet.nl wrote:
> You could bind a plugin to the process classes phase [1] which is a phase after compile but before packaging. If your class doesn't run as a plugin, you have a few options:
> 
> 1) Make a plugin, which runs your class. [2] 
> 2) Use the antrun plugin to fire of your class [3]

3) use the maven-exec-plugin to run your class

-dirk

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



Re: How can I let Maven run a class before packaging

Posted by Dirk Olmes <di...@xanthippe.ping.de>.
nicklist@planet.nl wrote:
> You could bind a plugin to the process classes phase [1] which is a phase after compile but before packaging. If your class doesn't run as a plugin, you have a few options:
> 
> 1) Make a plugin, which runs your class. [2] 
> 2) Use the antrun plugin to fire of your class [3]

3) use the maven-exec-plugin to run your class

-dirk

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


RE: How can I let Maven run a class before packaging

Posted by youhaodeyi <yo...@gmail.com>.
Thanks. antrun plugin can solve my problem.


Nick Stolwijk wrote:
> 
> You could bind a plugin to the process classes phase [1] which is a phase
> after compile but before packaging. If your class doesn't run as a plugin,
> you have a few options:
> 
> 1) Make a plugin, which runs your class. [2] 
> 2) Use the antrun plugin to fire of your class [3]
> 
> Hth,
> 
> Nick S.
> 
> [1]
> http://cvs.peopleware.be/training/maven/maven2/buildLifecyclePhases.html
> [2]
> http://maven.apache.org/guides/plugin/guide-java-plugin-development.html
> [3] http://maven.apache.org/plugins/maven-antrun-plugin/
> 
> -----Original Message-----
> From: youhaodeyi [mailto:youhaodeyi@gmail.com]
> Sent: Fri 4/11/2008 07:15
> To: users@maven.apache.org
> Subject: How can I let Maven run a class before packaging
>  
> 
> By default, Maven will package all the classes under target/classes
> directory
> into a jar file. But some classes are not generated by compiling, by
> running
> a Java application. How can I let Maven run a java application before
> packaging?
> -- 
> View this message in context:
> http://www.nabble.com/How-can-I-let-Maven-run-a-class-before-packaging-tp16625144s177p16625144.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-can-I-let-Maven-run-a-class-before-packaging-tp16625144s177p16626580.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


RE: How can I let Maven run a class before packaging

Posted by ni...@planet.nl.
You could bind a plugin to the process classes phase [1] which is a phase after compile but before packaging. If your class doesn't run as a plugin, you have a few options:

1) Make a plugin, which runs your class. [2] 
2) Use the antrun plugin to fire of your class [3]

Hth,

Nick S.

[1] http://cvs.peopleware.be/training/maven/maven2/buildLifecyclePhases.html
[2] http://maven.apache.org/guides/plugin/guide-java-plugin-development.html
[3] http://maven.apache.org/plugins/maven-antrun-plugin/

-----Original Message-----
From: youhaodeyi [mailto:youhaodeyi@gmail.com]
Sent: Fri 4/11/2008 07:15
To: users@maven.apache.org
Subject: How can I let Maven run a class before packaging
 

By default, Maven will package all the classes under target/classes directory
into a jar file. But some classes are not generated by compiling, by running
a Java application. How can I let Maven run a java application before
packaging?
-- 
View this message in context: http://www.nabble.com/How-can-I-let-Maven-run-a-class-before-packaging-tp16625144s177p16625144.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Re: How can I let Maven run a class before packaging

Posted by Luke Daley <ld...@ldaley.com>.
On 11/04/2008, at 3:15 PM, youhaodeyi wrote:

> By default, Maven will package all the classes under target/classes  
> directory
> into a jar file. But some classes are not generated by compiling,  
> by running
> a Java application. How can I let Maven run a java application before
> packaging?

You can use the ant exec task of the ant run plugin and bind it to  
the generate-sources phase…

http://maven.apache.org/plugins/maven-antrun-plugin/run-mojo.html

LD.



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