File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Maven Resources Files Not Correct In EAR Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Maven Resources Files Not Correct In EAR" Watch "Maven Resources Files Not Correct In EAR" New topic
Author

Maven Resources Files Not Correct In EAR

Che Frenz
Greenhorn

Joined: Dec 15, 2008
Posts: 14
Hi!
I have an ear made from a project with the following folder structure:
appx
----src
-------main
----------resources
---------------META-INF
---------------------weblogic-application.xml
---------------log4j.properties
---------------appx.properties

When I build the project with maven my jar files look like:
main
-----resources
--------META-INF
--------------weblogic-application.xml
--------log4j.properties
--------appx.properties
META-INF
-----MANIFEST.MF
-----application.xml
------------maven
----------------org....etc
test
-----resources

We're using maven-resources-plugin v.2.4.3.

EAR POM FILE
Here's a copy of my pom file.

<?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>

<!-- ============= -->
<!-- Coordinates -->
<!-- ============= -->

<name>Web Usermgmt Enterprise Application</name>
<description>${project.name} ${project.version}</description>
<packaging>ear</packaging>

<groupId>org.nrucfc.webusermgmt</groupId>
<artifactId>webusermgmt-ea</artifactId>
<version>1.0-SNAPSHOT</version>

<parent>
<groupId>org.nrucfc.webusermgmt</groupId>
<artifactId>webusermgmt</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<!-- ======= -->
<!-- Build -->
<!-- ======= -->

<build>
<plugins>

<!-- Enterprise Archive (EAR) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<modules>
<webModule>
<groupId>${project.groupId}</groupId>
<artifactId>webusermgmt-wa</artifactId>
<uri>webusermgmt-wa.war</uri>
<contextRoot>/webusermgmt</contextRoot>
</webModule>
</modules>
</configuration>
</plugin>

</plugins>

</build>

<!-- ============== -->
<!-- Dependencies -->
<!-- ============== -->

<dependencies>

<!-- project -->

<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>webusermgmt-wa</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>

</dependencies>

<!-- ======================== -->
<!-- Source Code Management -->
<!-- ======================== -->

<scm>
<connection>scm:svn:blahblah</connection>
<developerConnection>scm:svn:blahblah</developerConnection>
</scm>

</project>


I tried adding a resources property for the weblogic-application.xml but that didn't work either:
<resources>
<resource>
<directory>${project.basedir}/src/main/resources/META-INF</directory>
<targetPath>META-INF</targetPath>
<includes>
<include>weblogic-application.xml</include>
</includes>
</resource>
</resources>

PARENT POM FILE
Here's my parent pom:
<?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/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<!-- ============= -->
<!-- Coordinates -->
<!-- ============= -->

<name>Web Usermgmt Application</name>
<description>${project.name} ${project.version}</description>
<packaging>pom</packaging>

<groupId>org.nrucfc.webusermgmt</groupId>
<artifactId>webusermgmt</artifactId>
<version>1.0-SNAPSHOT</version>

<parent>
<groupId>org.nrucfc.bcm</groupId>
<artifactId>bcm-cfc</artifactId>
<version>1.5</version>
</parent>

<!-- ========= -->
<!-- Modules -->
<!-- ========= -->

<modules>
<module>webusermgmt-svc</module>
<module>webusermgmt-wa</module>
<module>webusermgmt-ea</module>
</modules>

<!-- ======================== -->
<!-- Source Code Management -->
<!-- ======================== -->

<scm>
<connection>scm:svn:blahblah</connection>
<developerConnection>scm:svn:blahblah</developerConnection>
</scm>

</project>

What am I doing wrong? Any suggestions are appreciated.
Thanks!
Che Frenz
Greenhorn

Joined: Dec 15, 2008
Posts: 14
Hi!

Never mind. I just realized that I had an incorrect version for the parent pom.

Thanks!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Maven Resources Files Not Correct In EAR
 
Similar Threads
Spring Application Context in Maven multi-module project
Ear Building in Maven
JBOSS DeploymentException : Not able to find module file : .war in a .ear file
maven error
Maven: deploy application to server