Thanks for the tip.  That has helped me a lot.  I noticed that the value of
the project.artifact property looks something like this:  artifact:
org.kurron.maven2:ear-one-WLS:ear:1.0-SNAPSHOT.  I don't suppose there is
convenient mechanism for obtaining the full path to the EAR, such as:
/home/me/.mvn/repository/.../my-app-1.0-SNAPSHOT.ear?  I think I have enough
data in the mojo to cobble together the pieces I need but I figured I would
see if there was something already built in.

Many Thanks,
Ron


Manuel Ledesma wrote:
> 
> Manuel Ledesma wrote:
>> kurron wrote:
>>> Our build system requires us to run vendor-specific J2EE compilers on 
>>> our EAR
>>> files.  I ran across the Weblogic plugin that can execute the appc 
>>> program
>>> on an archive but it requires that you specify archive information in 
>>> the
>>> POMs that create EARs.  What I would really like is to automagically 
>>> invoke
>>> appc on any EAR that gets built.  To that end, I've been 
>>> experimenting with
>>> writing a Java mojo that will invoke appc (or any other program we might
>>> need) right after an archive is created.  My mojo is getting handed the
>>> maven session, executed project,  current project and settings but, 
>>> to this
>>> point, I haven't been able to figure out how to obtain the artifact 
>>> that was
>>> just created.  I see printouts from my mojo so I know it is getting 
>>> called. When the mojo asks the executed project or the current 
>>> project what the
>>> artifact is, they return null.    The artifact id comes back as
>>> empty-project from both objects.  Can anyone offer any advice on how to
>>> obtain the full path to the artifact that was just created?    My 
>>> mojo is
>>> registered to go off during the package phase ( @phase package) and I 
>>> see it
>>> executing after the EAR/JAR/WARs are created so it appears to be getting
>>> called when I want it to.  Any help is appreciated.
>>>
>>> Thanks,
>>> Ron
>>>   
>> You can use the following expression
>>
>> //parameter 
>> expression="${project.build.directory}/${project.build.finalName}"
>>
>> base on packaging you can know if it's an ear, war or ejb.
>>
>> //
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> This all you need to write the plugin
> 
> **
>    * Compile classpath
>    *
>    * @parameter expression="${project.compileClasspathElements}"
>    * @required
>    * @readonly
>    */
>   private List<String> classpathElements;
> 
>   /**
>    * @parameter expression="${project.artifact}
>    */
>   private Artifact artifact;
> 
>   /**
>    * @parameter expression="${project.packaging}
>    */
>   private String packaging;
> 
> I wrote a plugin for appc too.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-M2--How-do-I-run-J2EE-compilers--tf2424323.html#a6776218
Sent from the Maven - Users mailing list archive at Nabble.com.


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

Reply via email to