maven-war-plugin

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

空扰寡人 提交于 2019-12-08 01:20:04
问题 When deploying a webapp I need to 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 the following: <plugin> <artifactId>maven-antrun-plugin</artifactId> <version>1.7</version> <executions> <execution> <phase>package</phase> <configuration> <target> <move file="${project.build.directory}/${project.name}-${project.version}/WEB-INF/classes/log4j.dev.properties" tofile="${project.build.directory}/${project

Renaming static files when building WAR file using Maven

回眸只為那壹抹淺笑 提交于 2019-12-07 16:26:49
问题 I want to rename static files when building my WAR file using maven-war-plugin, with version number. For intance, in my project I have a file: src/main/webapp/css/my.css I want it to appear in the WAR file as: css/my-versionNumber.css The same question was already asked (see Rename static files on maven war build), but the accepted answer is to rename a directory. I do not want to rename a directory, I want to rename the actual file. Is this possible? 回答1: OK, I found a way, the principles

How to call ant task to process webapp files after “copying webapp resources” and before “building war” steps in package phase?

倾然丶 夕夏残阳落幕 提交于 2019-12-07 12:56:36
问题 I'm migrating from ant to maven. However I have a custom build functionality for process web resources that I don't want to adapt yet to maven (the cost is very high) so I'm using ant run plugin. I want to process some of the resource files calling the ant task. This needs to happen after the "copying webapp resources" step and before the "building war" steps within the phase package. When I run my ant task, with the phase being "package" <plugin> <groupId>org.apache.maven.plugins</groupId>

Spring Boot & Maven war overlay

醉酒当歌 提交于 2019-12-07 05:13:26
问题 I'm working with a Maven multi module with a war depending on an other war. The Spring Boot webapp depends on a basic webapp that only serves html files. When I run the Spring Boot app, I'm able to access services and html from the main webapp (the Spring Boot one) but I can't access the html files from the dependency war (404). But these html files are well packaged in the Spring Boot webapp war... Here is a project that show the problem: https://github.com/cthiebault/spring-boot-war

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

梦想的初衷 提交于 2019-12-06 09:23:26
When deploying a webapp I need to 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 the following: <plugin> <artifactId>maven-antrun-plugin</artifactId> <version>1.7</version> <executions> <execution> <phase>package</phase> <configuration> <target> <move file="${project.build.directory}/${project.name}-${project.version}/WEB-INF/classes/log4j.dev.properties" tofile="${project.build.directory}/${project.name}-${project.version}/WEB-INF/classes/log4j.properties" /> <move file="${project.build.directory}/$

Spring Boot & Maven war overlay

十年热恋 提交于 2019-12-05 10:29:30
I'm working with a Maven multi module with a war depending on an other war. The Spring Boot webapp depends on a basic webapp that only serves html files. When I run the Spring Boot app, I'm able to access services and html from the main webapp (the Spring Boot one) but I can't access the html files from the dependency war (404). But these html files are well packaged in the Spring Boot webapp war... Here is a project that show the problem: https://github.com/cthiebault/spring-boot-war-overlays This project has 2 war modules: dependency-webapp : basic webapp serving just html (/dependency/index

Speed up maven war plugin

拈花ヽ惹草 提交于 2019-12-04 11:05:37
问题 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 myProject-1.0.0.war file from it. The copy process takes 10 minutes, building the .war takes 2 minutes. As I see the build could be much faster if the .war file will be assembled straight from the webapp folder. Is it possible to do? 回答1: I suggest that

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 09:41:33
问题 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,

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

做~自己de王妃 提交于 2019-12-03 07:11:59
问题 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

Speed up maven war plugin

旧时模样 提交于 2019-12-03 06:08:47
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 myProject-1.0.0.war file from it. The copy process takes 10 minutes, building the .war takes 2 minutes. As I see the build could be much faster if the .war file will be assembled straight from the webapp folder. Is it possible to do? I suggest that you use the use the war:inplace goal of maven-war-plugin together with a custom maven-antrun-plugin task. The