Questions tagged [maven-war-plugin]

The WAR Plugin is responsible for collecting all artifact dependencies, classes and resources of the web application and packaging them into a web application archive.

The WAR Plugin is responsible for collecting all artifact dependencies, classes and resources of the web application and packaging them into a web application archive.

The Maven War Plugin has a default binding to the package phase for Maven projects having a war packaging.

Check the official usage page for a first look at how to use this plugin.

More Info

226 questions
68
votes
7 answers

In Maven, how output the classpath being used?

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…
Alexander Bird
  • 38,679
  • 42
  • 124
  • 159
47
votes
5 answers

maven2: excluding directory from WAR

I tried this to exclude whole directory (${basedir}/src/main/webapp/webscripts) from my WAR file but it failed. What is wrong? this doesn't work:
pls
  • 473
  • 1
  • 4
  • 4
21
votes
2 answers

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

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…
16
votes
5 answers

How to remove version number from war file

I have a Dependency in child pom like this. sample-groupID sfint 1.0.0-SNAPSHOT war
rajan.sngh
  • 453
  • 2
  • 5
  • 17
14
votes
6 answers

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

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 | | …
Pierre Henry
  • 16,658
  • 22
  • 85
  • 105
11
votes
3 answers

Speed up maven war plugin

The maven plugin works very slow for me. In my project the webapp folder has nearly 15000 small files (images, jsp, css, etc). When I assemble it with the maven, it first copies all files to the target/myProject-1.0.0 directory, then builds…
kan
  • 28,279
  • 7
  • 71
  • 101
11
votes
2 answers

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

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...…
Patrick Clancey
  • 1,330
  • 1
  • 14
  • 22
10
votes
3 answers

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

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: org.apache.maven.plugins
Edy Bourne
  • 5,679
  • 13
  • 53
  • 101
10
votes
1 answer

Maven war-inplace: clean classes and lib folder

When you run the maven war:inplace all the classes and libraries are copied to the webapp folder of your project. When I update the version number of a library, i end up with two versions of the respective jar in the lib folder, the old one and the…
user655145
10
votes
1 answer

Can I make a Maven profile add webResources to a war and still add non-profiled webResources?

Example: I would hope and expect the following pom to deploy both profileResources and commonResources when the "profile" profile is active, but it deploys only profileResources. What can I do to achieve the desired effect?
Max Nanasy
  • 5,871
  • 7
  • 33
  • 38
9
votes
2 answers

What is the difference between `warSourceExcludes` and `packagingExcludes` in Maven

The Maven WAR plugin has two configuration options: warSourceExcludes and packagingExcludes. There is some documentation on packagingExcludes, saying that: It is possible to include or exclude certain files from the WAR file, by using the…
Kevin
  • 4,070
  • 4
  • 45
  • 67
9
votes
3 answers

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

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…
Justin Searls
  • 4,789
  • 4
  • 45
  • 56
9
votes
1 answer

How to run an eclipse m2e webapp project on a local server?

I'm trying to create a simple webapp as a maven project with m2e to help me manage dependencies, but I'm must be missing something, because I'm not able to run the project from eclipse. To put a bit more context, here is what I do: First, I choose…
Samuel Rossille
  • 18,940
  • 18
  • 62
  • 90
9
votes
2 answers

Modifying resources inside a war overlay in maven

I have this setup currently: Project A outputs a war file - has a configuration file (WEB-INF/web.xml). We've been delivering this with a commented out section of configuration which gets uncommented manually when the project is deployed in a…
M1EK
  • 820
  • 5
  • 10
8
votes
1 answer

Problem with Maven war plugin 3.0.0 due to an API incompatibility

I'm following this JSF tutorial https://www.tutorialspoint.com/jsf/index.htm. I think I've done everything that was written there (downloading all the required sw, setting the environment with path to the variables, etc.) but I cannot resolve a…
Domenico Romano
  • 83
  • 1
  • 1
  • 4
1
2 3
15 16