You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by zm <zz...@hotmail.com> on 2007/11/12 13:18:16 UTC
Cannot add custom resources to EAR's META-INF directory
Hi,
I'm new to maven, and I'm struggling to make a proper EAR build of an
existing project (created and maintained using IBM RAD 6).
The thing is, I'm creating an EAR, and it automatically creates the
application.xml file. But I have other resource files, xml ones, some are
created by IBM RAD to be interpreted by WebSphere, and I just want to
include them.
Whenever I include the resources (for testing I'm trying to include just the
info.xml file), maven just creates a "classes" directory with the resource
in it (it's META-INF), instead of including it inside the EAR's META-INF
file itself ...
Here are the pom.xml and the tree structure after "mvn clean package":
Many Thanks in advance.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.stock</groupId>
<artifactId>stock-ear</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>ear</packaging>
<name>stock EAR Project</name>
<url>http://stock.mycompany.com/ear</url>
<parent>
<groupId>com.mycompany.stock</groupId>
<artifactId>stock-root</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<dependencies>
<dependency>
<groupId>com.mycompany.stock</groupId>
<artifactId>stock-ejb</artifactId>
<version>1.0-SNAPSHOT</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>com.mycompany.stock</groupId>
<artifactId>stock-backoffice</artifactId>
<version>1.0-SNAPSHOT</version>
<type>war</type>
</dependency>
<dependency>
<groupId>com.mycompany.stock</groupId>
<artifactId>stock-webservices</artifactId>
<version>1.0-SNAPSHOT</version>
<type>war</type>
</dependency>
<dependency>
<groupId>com.mycompany.stock</groupId>
<artifactId>stock-tests</artifactId>
<version>1.0-SNAPSHOT</version>
<type>war</type>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>META-INF</directory>
<targetPath>META-INF</targetPath>
<filtering>false</filtering>
<includes>
<include>**/info.xml</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<displayName>stockEAR</displayName>
<description>stock Enterprise Application Resource</description>
<version>1.4</version>
<modules>
<jarModule>
<groupId>com.mycompany.stock</groupId>
<artifactId>stock-ejb</artifactId>
<includeInApplicationXml>true</includeInApplicationXml>
</jarModule>
<webModule>
<groupId>com.mycompany.stock</groupId>
<artifactId>stock-backoffice</artifactId>
<contextRoot>/stockBOWeb</contextRoot>
</webModule>
<webModule>
<groupId>com.mycompany.stock</groupId>
<artifactId>stock-webservices</artifactId>
<contextRoot>/stockWebService</contextRoot>
</webModule>
<webModule>
<groupId>com.mycompany.stock</groupId>
<artifactId>stock-tests</artifactId>
<contextRoot>/stockWeb</contextRoot>
</webModule>
</modules>
</configuration>
</plugin>
</plugins>
</build>
</project>
[ stock-ear directory ]
| .compatibility
| .j2ee
| .project
| .runtime
| .server
| axis.jar
| castor-0.9.7.jar
| commons-beanutils.jar
| commons-collections-3.1.jar
| commons-discovery.jar
| commons-fileupload-1.0.jar
| commons-lang-2.0.jar
| commons-logging.jar
| displaytag-1.0.jar
| jakarta-oro-2.0.8.jar
| jaxrpc.jar
| jdom.jar
| junit-3.8.1.jar
| log4j-1.2.8.jar
| pom.xml
| saaj.jar
| tree.txt
| webserviceutils.jar
| wsdl4j.jar
|
+---META-INF
| | .modulemaps
| | application.xml
| | ibm-application-bnd.xmi
| | ibm-application-ext.xmi
| | info.xml
| | MANIFEST.MF
| |
| +---ibmconfig
| +---cells
| +---defaultCell
| +---applications
| | +---defaultApp
| | +---deployments
| | +---defaultApp
| +---nodes
| +---defaultNode
| +---servers
| +---defaultServer
+---target
| application.xml
| stock-ear-1.0-SNAPSHOT.ear
|
+---classes
| +---META-INF
| info.xml
|
+---stock-ear-1.0-SNAPSHOT
| avalon-framework-4.1.3.jar
| axis-1.4.jar
| axis-jaxrpc-1.4.jar
| axis-saaj-1.4.jar
| axis-wsdl4j-1.5.1.jar
| castor-0.9.7.jar
| commons-discovery-20040218.194635.jar
| commons-lang-2.0.jar
| commons-logging-1.1.jar
| stock-backoffice-1.0-SNAPSHOT.war
| stock-common-1.0-SNAPSHOT.jar
| stock-ejb-1.0-SNAPSHOT.jar
| stock-ejb-client-1.0-SNAPSHOT.jar
| stock-tests-1.0-SNAPSHOT.war
| stock-webservices-1.0-SNAPSHOT.war
| jdom-1.0.jar
| log4j-1.2.8.jar
| logkit-1.0.1.jar
| servlet-api-2.3.jar
|
+---META-INF
application.xml
--
View this message in context: http://www.nabble.com/Cannot-add-custom-resources-to-EAR%27s-META-INF-directory-tf4790689s177.html#a13704596
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Cannot add custom resources to EAR's META-INF directory
Posted by Stephen Coy <st...@resolvesw.com>.
We are successfully using the Maven ear plugin to build ear files for
WAS 6.1. I don't believe that your problem is WAS specific however.
The ear plugin looks for its resources in src/main/application, so you
typically put your META-INF directory there with its extra websphere
descriptors.
ie.
src/
main/
application/
META-INF/
ibm-application-
bnd.xmi
etc
I say "typically" because if you really need to you can change which
directory the plugin uses with the "earSourceDirectory" configuration
parameter.
Cheers,
Steve Coy
On 12/11/2007, at 11:18 PM, zm wrote:
>
> Hi,
>
> I'm new to maven, and I'm struggling to make a proper EAR build of an
> existing project (created and maintained using IBM RAD 6).
>
> The thing is, I'm creating an EAR, and it automatically creates the
> application.xml file. But I have other resource files, xml ones,
> some are
> created by IBM RAD to be interpreted by WebSphere, and I just want to
> include them.
>
> Whenever I include the resources (for testing I'm trying to include
> just the
> info.xml file), maven just creates a "classes" directory with the
> resource
> in it (it's META-INF), instead of including it inside the EAR's META-
> INF
> file itself ...
>
> Here are the pom.xml and the tree structure after "mvn clean package":
>
> Many Thanks in advance.
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project xmlns="http://maven.apache.org/POM/4.0.0"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
> <modelVersion>4.0.0</modelVersion>
> <groupId>com.mycompany.stock</groupId>
> <artifactId>stock-ear</artifactId>
> <version>1.0-SNAPSHOT</version>
> <packaging>ear</packaging>
> <name>stock EAR Project</name>
> <url>http://stock.mycompany.com/ear</url>
> <parent>
> <groupId>com.mycompany.stock</groupId>
> <artifactId>stock-root</artifactId>
> <version>1.0-SNAPSHOT</version>
> </parent>
> <dependencies>
> <dependency>
> <groupId>com.mycompany.stock</groupId>
> <artifactId>stock-ejb</artifactId>
> <version>1.0-SNAPSHOT</version>
> <type>jar</type>
> </dependency>
> <dependency>
> <groupId>com.mycompany.stock</groupId>
> <artifactId>stock-backoffice</artifactId>
> <version>1.0-SNAPSHOT</version>
> <type>war</type>
> </dependency>
> <dependency>
> <groupId>com.mycompany.stock</groupId>
> <artifactId>stock-webservices</artifactId>
> <version>1.0-SNAPSHOT</version>
> <type>war</type>
> </dependency>
> <dependency>
> <groupId>com.mycompany.stock</groupId>
> <artifactId>stock-tests</artifactId>
> <version>1.0-SNAPSHOT</version>
> <type>war</type>
> </dependency>
> </dependencies>
> <build>
> <resources>
> <resource>
> <directory>META-INF</directory>
> <targetPath>META-INF</targetPath>
> <filtering>false</filtering>
> <includes>
> <include>**/info.xml</include>
> </includes>
> </resource>
> </resources>
> <plugins>
> <plugin>
> <artifactId>maven-ear-plugin</artifactId>
> <configuration>
> <displayName>stockEAR</displayName>
> <description>stock Enterprise Application Resource</description>
> <version>1.4</version>
> <modules>
> <jarModule>
> <groupId>com.mycompany.stock</groupId>
> <artifactId>stock-ejb</artifactId>
> <includeInApplicationXml>true</includeInApplicationXml>
> </jarModule>
> <webModule>
> <groupId>com.mycompany.stock</groupId>
> <artifactId>stock-backoffice</artifactId>
> <contextRoot>/stockBOWeb</contextRoot>
> </webModule>
> <webModule>
> <groupId>com.mycompany.stock</groupId>
> <artifactId>stock-webservices</artifactId>
> <contextRoot>/stockWebService</contextRoot>
> </webModule>
> <webModule>
> <groupId>com.mycompany.stock</groupId>
> <artifactId>stock-tests</artifactId>
> <contextRoot>/stockWeb</contextRoot>
> </webModule>
> </modules>
> </configuration>
> </plugin>
> </plugins>
> </build>
> </project>
>
>
>
>
>
>
> [ stock-ear directory ]
> | .compatibility
> | .j2ee
> | .project
> | .runtime
> | .server
> | axis.jar
> | castor-0.9.7.jar
> | commons-beanutils.jar
> | commons-collections-3.1.jar
> | commons-discovery.jar
> | commons-fileupload-1.0.jar
> | commons-lang-2.0.jar
> | commons-logging.jar
> | displaytag-1.0.jar
> | jakarta-oro-2.0.8.jar
> | jaxrpc.jar
> | jdom.jar
> | junit-3.8.1.jar
> | log4j-1.2.8.jar
> | pom.xml
> | saaj.jar
> | tree.txt
> | webserviceutils.jar
> | wsdl4j.jar
> |
> +---META-INF
> | | .modulemaps
> | | application.xml
> | | ibm-application-bnd.xmi
> | | ibm-application-ext.xmi
> | | info.xml
> | | MANIFEST.MF
> | |
> | +---ibmconfig
> | +---cells
> | +---defaultCell
> | +---applications
> | | +---defaultApp
> | | +---deployments
> | | +---defaultApp
> | +---nodes
> | +---defaultNode
> | +---servers
> | +---defaultServer
> +---target
> | application.xml
> | stock-ear-1.0-SNAPSHOT.ear
> |
> +---classes
> | +---META-INF
> | info.xml
> |
> +---stock-ear-1.0-SNAPSHOT
> | avalon-framework-4.1.3.jar
> | axis-1.4.jar
> | axis-jaxrpc-1.4.jar
> | axis-saaj-1.4.jar
> | axis-wsdl4j-1.5.1.jar
> | castor-0.9.7.jar
> | commons-discovery-20040218.194635.jar
> | commons-lang-2.0.jar
> | commons-logging-1.1.jar
> | stock-backoffice-1.0-SNAPSHOT.war
> | stock-common-1.0-SNAPSHOT.jar
> | stock-ejb-1.0-SNAPSHOT.jar
> | stock-ejb-client-1.0-SNAPSHOT.jar
> | stock-tests-1.0-SNAPSHOT.war
> | stock-webservices-1.0-SNAPSHOT.war
> | jdom-1.0.jar
> | log4j-1.2.8.jar
> | logkit-1.0.1.jar
> | servlet-api-2.3.jar
> |
> +---META-INF
> application.xml
>
>
> --
> View this message in context: http://www.nabble.com/Cannot-add-custom-resources-to-EAR%27s-META-INF-directory-tf4790689s177.html#a13704596
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
Re: Cannot add custom resources to EAR's META-INF directory
Posted by zm <zz...@hotmail.com>.
Any help appreciated, Thanks!
--
View this message in context: http://www.nabble.com/Cannot-add-custom-resources-to-EAR%27s-META-INF-directory-tf4790689s177.html#a13704649
Sent from the Maven - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org