See intermixed

> -----Original Message-----
> From: Pilgrim, Peter 
==////==
> 
> 
> Hi 
> 
> I finally got M2 and Antrun Plugin and the WebSphere ant task 
> WsEjbDeploy to work successfully.
> 
> I have a question on the M2 maven-ejb-Plugin. I would like to 
> intercept the EJB plugin after it creates the server side EJB 
> JAR in the `target' directory, but before it installs the 
> artifacts in the maven repository.
> 
> In other words I would like my websphere antrun command to 
> run on this stage temporary jar and then let the 
> maven-ejb-plugin take over. 


The SHORT ANSWER is the maven phase called 'verify' as documented 
in BBWM.


> 
> 1. maven-ejb-plugins creates the foo-ejb-1.0-SNAPSHOT.jar and 
> foo-ejb-1.0-SNAPSHOT client.jar 2. ant-run plugins runs wsejbdeploy
>    2a) wsejbdeploy takes the foo-ejb-1.0-SNAPSHOT.jar 
>    2b) wsejbdeploy outputs an foo-ejb-1.0-SNAPSHOT-TEMP.jar
>    2c) simply ant script swaps around 
> foo-ejb-1.0-SNAPSHOT.jar and foo-ejb-1.0-SNAPSHOT-TEMP.jar
> 3) maven-ejb-plugin is non-the-wiser installs the 
> foo-ejb-1.0-SNAPSHOT.jar into M2 repo.
> 
> 
> Is this possible?

The LONG ANSWER is because Maven has phases, and the EJB plugin
is build to execute different procedures on lifecycle phases.

Running the command `mvn install' causes the M2 to execute following
phases in order

[compiler:compile] 
[resources:testResources]
[compiler:testCompile] 
[resources:testResources]
[surefire:test] unit test are run

and only then does the EJB plug-in kick-in (pun intended)

[ejb:ejb] builds the EJB-JAR as you would expected

Because the ant-run is set on the phase called "verify", which
the phase before "install", then it will run

[ant:run] This runs the ANT script and WsEjbDeploy and now I
can "intercept" and process the EJB-JARs.  The script swaps
the input JAR with the proceesed output JAR

[install] The EJB plugin now executes agains and installs the EJB-JAR
into the M2 repository.

Job done.

I will document this craziness on my blog
http://jroller.com/page/peter_pilgrim
asap because this was too damn crazy.

==////==

--
Peter Pilgrim
UBS Investment Bank, 
PTS Portal / IT FIRC OPS LDN,
100 Liverpool Street, London EC2M 2RH, United Kingdom
:: Java EE / E-Commerce / Enterprise Integration / Development ::
 

Visit our website at http://www.ubs.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free
as information could be intercepted, corrupted, lost, destroyed,
arrive late or incomplete, or contain viruses.  The sender therefore
does not accept liability for any errors or omissions in the contents
of this message which arise as a result of e-mail transmission.  If
verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities or
related financial instruments.


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

Reply via email to