File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maven Resources Files Not Correct In EAR

 
Che Frenz
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

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

Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic