Hi,
I'm in the process of creating Maven builds for a few applications. These
applications use Ant build scripts to create WAR and EAR files.
Initial situation:
* All source code is stored in our Subversion repository.
* Each application depends on several internal projects P1, P2, ... that
all have a non-Maven-like structure.
* Most, but not all of them not only contain Java code, but also web
resources (HTML, JavaScript, XSL, ...) that have to be placed directly
under "/" or under "/WEB-INF" in the resulting application WAR(s).
Actual situation:
* For each internal project P that contains only Java code I have created
a new Maven project mvn-P using Maven conventions and directory layout;
Java code is referenced under src/main/java via svn:externals.
* For each project Q that contains both Java sources and resource files, I
have created two Maven projects mvn-Q and mvn-Q-resources; as above Java
code and resources are referenced via svn:externals. The mvn-Q-resources
project is of type pom and uses the assembly plugin to create a zip
archive containing the resources; i.e. builds an artifact named
mvn-Q-resources-<version>-zip.zip
For one of the WAR and EAR projects I created a multi-module Maven project
to build the same WAR and EAR via Maven as the legacy Ant script. The
structure is basically the following:
app-main
+- app-jar
+- mvn-p
\- mvn-q
+- app-war
+- app-jar
\- mvn-q-resources
+- app-ear
\- app-war
The app-war pom.xml contains the following:
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<!-- web resources -->
<overlays>
<overlay>
<groupId>mygroup</groupId>
<artifactId>mvn-Q-resources</artifactId>
<type>zip</type>
<classifier>zip</classifier>
<targetPath>/WEB-INF</targetPath>
<includes>
<include>/xsl/**</include>
</includes>
</overlay>
...
</overlays>
</configuration>
</plugin>
...
</plugins>
<dependencies>
<dependency>
<groupId>mygroup</groupId>
<artifactId>mvn-Q-resources</artifactId>
<version>1.0-SNAPSHOT</version>
<type>zip</type>
<classifier>zip</classifier>
<scope>runtime</scope>
</dependency>
...
</dependencies>
So far, this works pretty fine using command-line Maven.
The problem:
My Eclipse workspace contains all necessary projects, i.e. mvn-P, mvn-Q,
mvn-Q-resources, app-main, app-jar, app-war and app-ear. In the server
view I created a new instance using a locally installed Tomcat. After
adding app-war to it I see all the project's jar dependencies in the view.
But:
Although I can start the server and debug in the referenced dependencies,
the WAR application doesn't run correctly because the referenced resources
are not available, i.e. everything I added to m-war-p via
overlays/overlay.
I'm using the following:
* Eclipse Mars 4.5 (Build id: I20150203-1300)
* Java EE Developer Tools 3.7.0.v201501282120
* m2e 1.6.0.20150220-1952
* m2e-wtp 1.2.0.20150212-1712
* Tomcat v8.0.20
* Java 7u76
Do you have any hints on how to solve this?
Do I need to change something?
Is m-assembly-p the right way to create an archive containing resources
that are shared between other applications?
Regards
Thorsten_______________________________________________
m2e-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from
this list, visit
https://dev.eclipse.org/mailman/listinfo/m2e-users