maven-war-plugin

Exec goals before war archive package

久未见 提交于 2020-01-04 02:11:14
问题 I want to run maven-replacer-plugin just before packaging war. I have find "prepare-package" phase but it triggered before war assembled and all resources copied, but I need to make changes when all resources copied and just before archive create. Is this possible in maven? BTW, I use maven-2.2.1. Thanks. 回答1: I have found answer in maven replacer plugin WIKI. The trick is to make all things after war:exploded but then use <useCache>true</useCache> property in war plugin configuration. And

How to remove version number from war file

我与影子孤独终老i 提交于 2019-12-30 04:46:26
问题 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

How do you set the targetPath of jar overlay in a war?

拟墨画扇 提交于 2019-12-24 17:14:37
问题 I was reading the war plugin's overlay documentation and it said: targetPath - the target relative path in the webapp structure, which is only available for overlays of type war. By default, the content of the overlay is added in the root structure of the webapp. But I'm trying to overlay a jar, not a war. I don't want the files to be at the root directory. 回答1: Answering my own question: Turns out that documentation is wrong and you can use a targetPath with a type, jar . 来源: https:/

How to revert Maven project.build variables after Clover plugin finishes?

孤街浪徒 提交于 2019-12-24 10:51:43
问题 I'm attempting to add integration tests to a large Maven project. Here is the desired order of events: Clean existing artifacts. Resolve dependencies and build project. Run unit tests via Surefire plugin. Fork lifecycle for Clover plugin. --- Instrument sources using Clover plugin. --- Modify project.build.directory and project.build.finalName for Clover. --- Build Clover instrumented project in a new directory. --- Run Clover instrumented unit tests via Surefire plugin. --- Check code

Filtering in Maven War Plugin

给你一囗甜甜゛ 提交于 2019-12-23 20:34:24
问题 I don´t understand the following filter configuration for the maven war plugin. Could somebody explain me please, what they are doing? I have marked the code with First Example and Second Example <plugin> <artifactId>maven-war-plugin</artifactId> <configuration> <webResources> <!--First Example--> <resource> <directory>/src/main/webapp</directory> <filtering>true</filtering> <includes> <include>**/*.xml</include> <include>**/*.xhtml</include> </includes> </resource> <!--Second Example-->

maven2: excluding directory from WAR

那年仲夏 提交于 2019-12-17 10:33:36
问题 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: <configuration> <webResources> <resource> <directory>${basedir}/src/main/webapp/webscripts</directory> <excludes> <exclude>**/*.*</exclude> </excludes> </resource> </webResources> </configuration> this too: <configuration> <webResources> <resource> <directory>${basedir}/src/main/webapp</directory> <excludes> <exclude>**/webscripts</exclude> <

maven-war-plugin ignores <archiveClasses>

爷,独闯天下 提交于 2019-12-14 03:16:33
问题 The <archiveClasses> option has no effect. Running mvn clean compile war:exploded produces a war directory with .class files in the classes directory, and they are not archived into a jar in the lib directory neither. war:war produces same result. Plugin configuration: ... <plugin> <artifactId>maven-war-plugin</artifactId> <version>2.6</version> <configuration> <archiveClasses>true</archiveClasses> </configuration> </plugin> ... Workarounds? Maven version 3.3.3, maven-war-plugin version 2.6.

problem with maven webapp-cache.xml

♀尐吖头ヾ 提交于 2019-12-12 15:56:27
问题 We have a web application configured with maven. I have done a re-factoring (moved a file from one package to another) outside of eclipse, since this is not setup on eclipse and it is small fix. But, however I did forget to update reference to this file in a file. Then I did mvn clean install surprisingly it is built successfully. Later it got failed on CI machine. When I searched for text occurrences of the file I have re-factored, I have found an occurrence of this file name in target\war

How to autowire @service from external Jar in Spring

自古美人都是妖i 提交于 2019-12-12 01:55:53
问题 I am developing two spring based application(Ex app1 and app2) fully on Java configuration with Maven and no XML config. Through Maven -WAR plugin , I have created Jar reference of app2 and using mvn install:install file I have binded the app2 jar with app1. app2 - Its used to fetch inforamtion from data source. I have autowired the app2 serive in app1 implementation class to fetch the details which was annotated with @Service in app2 application. My first doubt is: Both app1 and app2 have

maven-war-plugin chmod exit code was:127

核能气质少年 提交于 2019-12-11 02:22:40
问题 I am running a shell to call a ant, which further call a maven in Redhat. Could anyone point out the context of this error? [ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.3:wa r (default-war) on project sites: Error unpacking file [/scratch/mingtzha/12.1/.../sites-dojo/target/sites-dojo-1.6.1-12.1.4.0-SNAPSHOT.war]to [/scratch /mingtzha/12.1/.../sites-dojo]: chmod exit code was: 127 -> [Help 1] I found this "useJvmChmod" property maybe relevant. http://maven.apache