maven-war-plugin

In Maven2, what's the simplest way to build a WAR and the EAR to contain that WAR in a single POM?

会有一股神秘感。 提交于 2019-12-03 01:13:48
Situation is pretty straightforward. I have a Java webapp that I'm converting to be built with Maven. At present, the app is built with Ant into a single WAR file, which is then bundled into an EAR with a very simple application.xml. maven-war-plugin and maven-ear-plugin both look pretty straightforward to me, and it appears they're setting me up to be forced to consider the above as two distinct projects, with the WAR project as a dependency of the EAR project. This seems a tad inconvenient, especially because a profile setting of the WAR project will change for each environment, which seems

Maven Error assembling WAR: webxml attribute is required when building the SpringMVC project with pure Java Based Configuration and no xml's

佐手、 提交于 2019-12-02 20:48:28
I am developing a Spring MVC project with pure Java based configuration. I am getting the error below when I do a Maven clean install. Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project SpringMVC-ShoppingCart: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1] The error says that web.xml is missing, but I did not have one since I used pure Java based configuration. How to make sure that the project builds and creates war file without web.xml ? Tunaki This error happens

Why is maven-war-plugin failing for web.xml missing if I configured it not to fail on missing web.xml?

若如初见. 提交于 2019-12-01 03:57:19
Here's a challenge: why is this build failing? I have configured Maven's maven-war-plugin not to fail on an abscent web.xml file, it seems: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <executions> <execution> <id>prepare-war</id> <phase>prepare-package</phase> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> <archiveClasses>false</archiveClasses> <archive> <manifest> <addClasspath>true</addClasspath> <classpathPrefix /> </manifest> <manifestEntries> <Implementation-Build>${build.number}</Implementation-Build> <Implementation

Why is maven-war-plugin failing for web.xml missing if I configured it not to fail on missing web.xml?

▼魔方 西西 提交于 2019-12-01 00:10:50
问题 Here's a challenge: why is this build failing? I have configured Maven's maven-war-plugin not to fail on an abscent web.xml file, it seems: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <executions> <execution> <id>prepare-war</id> <phase>prepare-package</phase> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> <archiveClasses>false</archiveClasses> <archive> <manifest> <addClasspath>true</addClasspath> <classpathPrefix /> <

How to remove version number from war file

蹲街弑〆低调 提交于 2019-11-30 23:00:21
I have a Dependency in child pom like this. <dependencies> <dependency> <groupId>sample-groupID</groupId> <artifactId>sfint</artifactId> <version>1.0.0-SNAPSHOT</version> <type>war</type> </dependency> </dependencies> And I am using maven-ear-plugin. <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven.ear.plugin</artifactId> <version>2.10</version> <configuration> <modules> <webModule> <groupId>sample-gropuID</groupId> <artifactId>sfint</artifactId> <version>1.0.0-SNAPSHOT</version> <moduleID>WebModule_sfint</moduleID> <bundleFileName>sfint.war</bundleFileName> <

How to overwrite files in the WAR file during maven build?

倖福魔咒の 提交于 2019-11-30 13:24:15
问题 I have a Java webapp project that I develop in Eclipse (more precisely MyEclipse 10) and build using Maven 3. I have the following layout (including only the files relevant to my problem : project root |-- src | |-- main | | |-- java | | |-- resources | | | |-- log4j.xml | | | +-- struts.properties | | |-- webapp | | | |-- META-INF | | | | +--context.xml | | |-- config | | | |-- test | | | | |--log4j.xml | | | | |--struts.properties | | | | +--context.xml | | | +-- prod | | | | |--log4j.xml |

In Maven, how output the classpath being used?

柔情痞子 提交于 2019-11-30 11:17:04
问题 For my current purposes I have a Maven project which creates a war file, and I want to see what actual classpath it is using when creating the war . Is there a way to do that in a single command -- without having to compile the entire project? One idea is to have Maven generate the target/classpath.properties file and then stop at that point. 回答1: To get the classpath all by itself in a file, you can: mvn dependency:build-classpath -Dmdep.outputFile=cp.txt Or add this to the POM.XML: <project

How to overwrite files in the WAR file during maven build?

♀尐吖头ヾ 提交于 2019-11-30 07:11:38
I have a Java webapp project that I develop in Eclipse (more precisely MyEclipse 10) and build using Maven 3. I have the following layout (including only the files relevant to my problem : project root |-- src | |-- main | | |-- java | | |-- resources | | | |-- log4j.xml | | | +-- struts.properties | | |-- webapp | | | |-- META-INF | | | | +--context.xml | | |-- config | | | |-- test | | | | |--log4j.xml | | | | |--struts.properties | | | | +--context.xml | | | +-- prod | | | | |--log4j.xml | | | | |--struts.properties | | | | +--context.xml | +--test +--pom.xml As you can see, I included a

In Maven, how output the classpath being used?

五迷三道 提交于 2019-11-29 23:33:31
For my current purposes I have a Maven project which creates a war file, and I want to see what actual classpath it is using when creating the war . Is there a way to do that in a single command -- without having to compile the entire project? One idea is to have Maven generate the target/classpath.properties file and then stop at that point. To get the classpath all by itself in a file, you can: mvn dependency:build-classpath -Dmdep.outputFile=cp.txt Or add this to the POM.XML: <project> [...] <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency

Run an ant task in maven build phase before war is packaged?

和自甴很熟 提交于 2019-11-29 04:05:28
When deploying a webapp I need to update some variables in UI resources, unzip some assets and concat some files, currently this is achieved via an ant task. I'm trying to run this task in the maven build process using something like this... <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-antrun-plugin</artifactId> <version>1.6</version> <executions> <execution> <id>deploy-ui</id> <phase>prepare-package</phase> <inherited>false</inherited> <configuration> <target> <property name="buildDir" value="${project.build.directory}/${project.build.finalName}" /> <ant antfile=