What magic puts jars into rhq.ear/lib/ ?

Ian Springer ian.springer at redhat.com
Tue Oct 25 14:05:48 UTC 2011


In the root pom, we configure the ejb plugin as follows:

<plugin>
<artifactId>maven-ejb-plugin</artifactId>
<configuration>
<ejbVersion>3.0</ejbVersion>
<archive>
<manifest>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
             ...

The addClasspath=true and classpathPrefix=lib/ options tell the plugin 
to add all the runtime dependencies of any ejb-jar module (e.g. domain 
or server-jar) to the jar's manifest. For example, the server jar's 
manifest ends up containing:

Class-Path: lib/rhq-enterprise-comm-4.1.0-SNAPSHOT.jar lib/rhq-core-ut
  il-4.1.0-SNAPSHOT.jar lib/jdom-1.0.jar lib/rhq-core-comm-api-4.1.0-SN
  APSHOT.jar lib/jboss-remoting-2.2.2.SP8.jar lib/jboss-serialization-1
  .0.3.GA.jar lib/rhq-enterprise-server-xml-schemas-4.1.0-SNAPSHOT.jar
  lib/jaxb-impl-2.1.9.jar lib/rhq-core-client-api-4.1.0-SNAPSHOT.jar li
  b/rhq-core-dbutils-4.1.0-SNAPSHOT.jar lib/safe-invoker-4.1.0-SNAPSHOT
  .jar lib/jbossws-native-core-3.1.1.GA.jar lib/jbossws-spi-1.1.1.GA.ja
  r lib/rhq-common-drift-4.1.0-SNAPSHOT.jar lib/commons-io-1.4.jar lib/
  diffutils-1.2.1.jar lib/xml-apis-1.3.03.jar lib/antlr-3.2.jar lib/ant
  lr-runtime-3.2.jar lib/stringtemplate-3.2.jar lib/commons-beanutils-1
  .6.1.jar lib/commons-collections-3.2.jar lib/commons-httpclient-3.0.1
  .jar lib/commons-codec-1.2.jar lib/commons-lang-2.4.jar lib/commons-v
  alidator-1.1.4.jar lib/dom4j-1.6.1-jboss.jar lib/getopt-1.0.13.jar li
  b/i18nlog-1.0.10.jar lib/jboss-cache-1.4.1.SP9.jar lib/jbpm-3.1.1.jar
   lib/junit-3.8.1.jar lib/snmp4j-1.8.2.jar lib/concurrent-1.3.4.jar li
  b/postgresql-9.0-801.jdbc4.jar lib/rss4j-0.92-on.2.jar lib/jsch-0.1.2
  9.jar

The second piece of the magic is the following in the ear pom:

<plugin>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<displayName>RHQ</displayName>
<workDirectory>${earDirectory}</workDirectory>
<resourcesDir>${basedir}/target/classes</resourcesDir>
<defaultJavaBundleDir>lib</defaultJavaBundleDir>
                ...

The defaultJavaBundleDir=lib option tells the ear plugin to copy the 
runtime dependencies of any of its ejb modules into a lib subdirectory 
within the ear, which is where the jars' manifests said they would be at 
runtime.


On 10/25/2011 08:49 AM, Heiko W.Rupp wrote:
> Hi,
>
> what magic is putting all the libraries into rhq.ear/lib/?
>
> Thanks
>
>   Heiko
>
> _______________________________________________
> rhq-devel mailing list
> rhq-devel at lists.fedorahosted.org
> https://fedorahosted.org/mailman/listinfo/rhq-devel


-- 
Ian Springer
Principal Software Developer
JBoss Operations Network
Red Hat
ian.springer at redhat.com



More information about the rhq-devel mailing list