[jboss-user] [JBoss AOP] - Re: Maven 2 plugin?

elysch do-not-reply at jboss.com
Mon Dec 3 09:26:00 EST 2007


"afloom" wrote : I'm looking for a way of getting my jar files being named xxx.aop. After reading on 
  | the Maven forum, I understand it should be done by creating a new packaging type. Is that something 
  | supported by this plugin or something that could be added?
  | ...
  | /Anders
  | 

Hi all.

My project is composed by different modules, like "sades-common", "sades-core", "sades-web" and
"sades-app". (The standard AndroMDA structure)

What I needed to do in order to create the *.aop file in the ear is:

a) I added a module called "sades-aop" to contain my aop code. 
It contains the jboss-aop.xml placed at: "src\main\resources\META-INF".

and

b) I added
<bundleFileName>${application.id}-aop-${pom.version}.aop</bundleFileName>
to the pom.xml file of my app module. (the one that builds the final ear file).

It contains:

...
  |     <dependencies>
  | ..
  |         <dependency>
  |             <groupId>${pom.groupId}</groupId>
  |             <artifactId>sades-aop</artifactId>
  |             <version>${pom.version}</version>            
  |         </dependency>
  | ...
  |     </dependencies>
  | ...
  |     <build>
  |         <finalName>${application.id}-${pom.version}</finalName>
  | ...
  |         <plugins>
  |             <plugin>
  |                 <groupId>org.apache.maven.plugins</groupId>
  |                 <artifactId>maven-ear-plugin</artifactId>
  |                 <version>2.1</version>
  |                 <configuration>
  |                     <includes>**/*.xml</includes>
  |                     <excludes>**/jboss-app.xml</excludes>
  |                     <version>1.4</version>
  |                     <modules>
  |                         <javaModule>
  |                             <groupId>${pom.groupId}</groupId>
  |                             <artifactId>sades-aop</artifactId>
  |                             <bundleFileName>${application.id}-aop-${pom.version}.aop</bundleFileName>
  |                             <includeInApplicationXml>true</includeInApplicationXml>
  |                         </javaModule>
  |                         <javaModule>
  |                             <groupId>${pom.groupId}</groupId>
  |                             <artifactId>sades-common</artifactId>
  |                             <includeInApplicationXml>true</includeInApplicationXml>
  |                         </javaModule>
  |                         <ejbModule>
  |                             <groupId>${pom.groupId}</groupId>
  |                             <artifactId>sades-core</artifactId>
  |                         </ejbModule>
  |                         <webModule>
  |                             <groupId>${pom.groupId}</groupId>
  |                             <artifactId>sades-web</artifactId>
  |                             <contextRoot>/${application.id}</contextRoot>
  |                         </webModule>
  |                     </modules>
  |                 </configuration>
  |             </plugin>
  | ...


This way I obtain an ear file with the correct structure (as far as I can tell):

sades-1.0-SNAPSHOT.ear
  |     META-INF
  |         application.xml
  | ...
  |     sades-aop-1.0-SNAPSHOT.aop
  |         META-INF
  |             jboss-aop.xml
  | ...
  |     sades-common-1.0-SNAPSHOT.jar
  | ...
  |     sades-core-1.0-SNAPSHOT.jar
  | ...
  |     sades-web-1.0-SNAPSHOT.war
  | ...

I hope this helps someone else.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4109864#4109864

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4109864



More information about the jboss-user mailing list