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]

Reply via email to