All Questions
Tagged with maven-war-plugin maven
193 questions
0
votes
0
answers
47
views
maven-war-plugin will not generate MANIFEST file
I have an older project that has a manually defined MANIFEST.MF file checked in that I'm trying to delete and autogenerate instead.
Maven makes it sound like this should be a simple task, but it hasn'...
0
votes
0
answers
100
views
maven-war-plugin : unable to load the mojo
I am running java version "21.0.4" 2024-07-16 LTS
I downloaded the https://github.com/eclipse-ee4j/glassfish-samples. and trying to buld the jakarta9 files.
I get Caused by: org.apache.maven....
0
votes
2
answers
145
views
IntelliJ cannot find maven-war-plugin
It gives me this error in pom
The plugin is correctly available in m2 folder
other libraries are also recognized well, and the plugin is available in server...
I've tried to invalidate & ...
0
votes
0
answers
112
views
maven-war-plugin copies only subdirectories (including files). Not just files
I am using the maven-war-plugin (version 3.3.2) in order to copy a jar file from target/lib/v1 into the WEB-INF/lib of the WAR file.
The jar file is located under: target/lib/v1/myJar.jar
The pom.xml ...
0
votes
3
answers
411
views
Exclude transitive maven dependencies from generated war file
I am in the process of converting a monolithic legacy enterprise application to use maven instead of ant. I created a list of dependencies that ant was using for the builds and accordingly created a ...
0
votes
0
answers
75
views
How to apply jar patch while creating war file using maven
I have maven project that creates the war file. It includes the all the jars from dependencies.
In my case, some jar we received as a product patch. These jar should be overwrite the existing jars ...
0
votes
1
answer
501
views
Exclude JARs from final WAR doesn't work with spring-boot-maven-plugin
I have a Spring Boot application that is packaged as WAR file and I run it on embedded Apache Tomcat. Using this dependency
<dependency>
<groupId>org.springframework.boot</groupId&...
0
votes
1
answer
282
views
War external dependency overlay - move jars from WEB-INF/lib-new to WEB-INF/lib
I am working on a maven project with a war external dependency (let's call this war dependency WAR-DEP)
After the build and during the package phase I am taking the content of WAR-DEP and merging it ...
0
votes
1
answer
2k
views
Getting a logback.xml from a dependency jar and filtering it with the maven-war-plugin
We have a common logback.xml file that we would like to use across different web apps. It includes a RollinFileAppender which should see files named as the project artifactId. The logback.xml ...
0
votes
1
answer
429
views
Problem after implement packagingExcludes in maven
I have app that build with different profiles using spring profiles. i have to implement packagingExcludes to exclude websocket-*.jar because its make conflict with tomcat after deploy.
so , i add ...
0
votes
1
answer
316
views
Maven WAR overlay - merge resources into a different path
I'm using maven 4.0.0. I'm using an overlay in the maven-war-plugin to merge app1 into app2. I want to merge some of the directories in app1 into a different location in app2. Essentially move the ...
0
votes
1
answer
743
views
How to include specific files in war using maven
I'm having some trouble trying to figure out a good way to control which resources to include in a war using maven. In my src/main/resources directory I have two files, logback.xml and logback-test....
0
votes
0
answers
437
views
Deploy JAR and WAR to Nexus
I'm working on a JAVA based application. The POM has been so configured that the packaging phase generates an executable JAR (with the maven-shade-plugin) and a WAR (with the war-plugin). The main ...
0
votes
0
answers
466
views
Why can't I read MANIFEST.MF file generated by maven when packaging jar?
I have two separate projects: one is spring-boot with jar packaging, and one is a non-spring-boot app with war packaging.
In my spring-boot application, I use maven-jar-plugin to generate MANIFEST.MF ...
1
vote
0
answers
475
views
maven-war-plugin basedir <workspace>/target/dist does not exist
We're trying to build a Java-based project with Maven (v3.5.4) and with the JDK 1.8.92 but we getting an error Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on ...
0
votes
0
answers
99
views
Can i make maven-war-plugin to *only* copy the classes.jar but not the .war into local repo?
OK, so i'm using the maven-war-plugin to build my war, which works fine.
I also have it setup to generate a -classes.jar.
When i run the build, both the war and -classes.jar gets copied into my .m2 ...
0
votes
1
answer
233
views
Setting a property for only a specific phase
I want to be able to set a property for a specific maven phase. How can I do that?
For example, assume that I want to set a property like this:
<properties>
<spring.profiles.active>...
4
votes
1
answer
862
views
How to have version in WAR filename, but not require it in the URL when deployed in Tomcat
I want to version my WAR to make DevOps lives easier, i.e.: foo-3.2.0.war. In pom.xml, I have:
<build>
<finalName>foo</finalName>
but also
<plugin>
<groupId>org....
0
votes
1
answer
573
views
How to modify the contents or replace a file which resides in webapp directory of a Maven webapp project
I've a Maven webapp project. It has a default directory structure as below -
|-- pom.xml
`-- src
`-- main
|-- java
| `-- com
| `-- example
| ...
0
votes
0
answers
57
views
Excluding folder from resources in Maven War Plugin
I've the following structure in my src/main/resources:
resources
|-config
|-log4j
|-app
When building a war, Maven should exclude the app-Folder. I both tried ...
9
votes
1
answer
15k
views
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 ...
3
votes
1
answer
4k
views
minify-maven-plugin (com.samaxes.maven v1.7.6) is not replacing the minified files with the original files
I want to minify JS and CSS files in maven project. I have used minify-maven-plugin (com.samaxes.maven v1.7.6). As per the documentation (https://samaxes.github.io/minify-maven-plugin/minify-mojo....
0
votes
1
answer
150
views
maven-war-plugin: jar deployed twice in nexus when attachClasses set to true
I have a very similar problem as exposed in maven jar deployed twice in a war module with attachClasses set to true, except that my setting is different and that what seems to have helped, doesn't ...
0
votes
1
answer
936
views
DevOps - Maven: org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.6:war
I'm configuring my maven project on DevOps, but I receive an assembling WAR error.
I've uploaded my project on the DevOps Repository and created a pipeline.
My pipeline is composed by the following ...
0
votes
1
answer
320
views
Renaming jar of the same Maven project before bundling it into its war file
We've a Maven project that has war packaging. It has a couple of other projects as dependencies. The requirement here is that all projects added as dependencies should have a common naming convention ...
0
votes
0
answers
223
views
maven-war plugin war generating time
maven-war pluging used in my project performs below operations as part of build process and creating war.
Exploding webApp
Assembling webApp {project's webapp module} into the directory (target ...
1
vote
1
answer
1k
views
Angular /assets/ not found on serving maven webapp in tomcat
My maven webapp has the following structure
-webapp
-dist
-errors
-WEB-INF
The 'dist' folder has all the angular build files. In pom.xml I am using maven-resources plugin to copy the content of ...
0
votes
1
answer
931
views
Maven: remove "-version-SNAPSHOT" suffix from downloaded dependencies
I'm using <finalName> in build section of maven to rename my-artifact-<project.version>-SNAPSHOT.jar to my-artifact.jar, I see that the resulting artifact is renamed as expected in my ...
0
votes
1
answer
672
views
maven war overlay won't exclude dependancies
I have a project where I am attempting to overlay a pre-built war with a compiled jar from another module and some files in the war project.
+pom.xml
|
+-+depandancy_dir
| |
| + source.war
|
+-+ jar
|...
0
votes
1
answer
164
views
Filtering out provided dependencies for a war
If I build a war for a specific platform (e.g. Wildfly), I need to filter out dependencies that are already provided by the platform.
Up to now, we do this by using a special BOM that lists all the ...
0
votes
1
answer
290
views
In Maven, how to compile a class outside the source directory into an arbitrary target directory?
I have a legacy app that I'm porting from Ant to Maven. My Maven build works fine for the main project, which I've moved into the standard Maven directory layout (*.java files in /src/main/java/) and ...
4
votes
0
answers
403
views
Difference between ${scmBranch} and $\{scmBranch} for maven-jar-plugin/ maven-war-plugin
I do use the maven-jar-plugin in my pom.xml.
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
...
0
votes
0
answers
1k
views
Maven-war-plugin fails during mvn install execution due to web.xml is not found
I am trying to make a simply "mvn clean install" execution in a Maven project but it fails with this error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war->plugin:2.2:war (...
0
votes
1
answer
1k
views
WEB-INF/classes empty upon MavenBuild
I am building a multi modules project the hierarchy for it as follow :
ParentProject
|_ WebModule
|_src
|_main
...
-1
votes
1
answer
194
views
tomcat deploy plugin with child war projects
i have main project with 3 war modules i need to deploy the main war file using tomcat-maven-plugin
Parent
- Main War Project child of Parent(Has dependecy of 3 war modules)
- war module child ...
1
vote
0
answers
328
views
maven-war-plugin version cause OOM
I have a web app built using maven-war-plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
...
0
votes
0
answers
30
views
Maven War Plugin Exclusions (need to exclude an entire dir)
I've got my project structured as such:
Here is the plugin element I'm using for the maven-war-plugin:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>...
0
votes
0
answers
359
views
WAR files behaves differently which are build by INTELLIJ IDEA and MAVEN WAR Plugin
I am trying to migrate Eclipse JAVA EE Web Application to Maven project.
My project has Eclipse BIRT dependency and Eclipse BIRT releases are not mavenized. Therefore, i added all BIRT jar files ...
7
votes
1
answer
1k
views
Eclipse and maven-war-plugin explode
I'm running against a brick with Eclipse.
I will try to explain. I'm working on a project that "abused" of maven overlays and have many modules that have Javascript and LESS files inside the webapp.
...
3
votes
2
answers
2k
views
maven war plugin does not forget about old files and dependencies and creates a war that contains removed files and dependencies
Hello I'm having a weird problem about war creation.
I use maven-war-plugin (tried with 3.1.0, 3.2.0, and 2.6). When I run war:war (or mvn clean package, or similars) the war is created but I noticed ...
0
votes
1
answer
432
views
Set JAR name packaged inside a WAR
I created a WAR project and a JAR project, setted like dependency of the WAR the JAR project, I used the tag <finalName> in the JAR project pom file to set the file's name when the WAR is ...
0
votes
1
answer
651
views
Build war including WebContent of another project in main service project
I have a project having current file structure as(This works fine):
project-services
- src/main/java
- WebContent
- pom.xml
project-services pom.xml
...
<build>
<...
0
votes
2
answers
181
views
Springboot: application.properties path motification not taken into account
I'm creating a war file from a simple Spring boot (1.x) project, and I would like to modify the Context path.
For that purpose, I have an application.properties file that looks like this:
server....
0
votes
0
answers
139
views
maven-war-plugin - changing the location of files in the output war file
I am converting existing projects to maven.
My task is to just write a POM which will create an exact deployables as ANT script is producing.
I have to match MAVEN output war file with ANT ...
6
votes
1
answer
3k
views
How can I avoid build failing when Maven war plugin can't find webResource directory?
I am working with a module that produces a WAR artifact through Maven. The module has a typical src/main/webapp directory. I'm using Maven's war plugin to supplement the webapp directory with another ...
1
vote
1
answer
1k
views
Maven war plugin creates war with multiple versions of same jar
I experience following problem. I've got a legacy application where the maven-war-plugin in following way:
<plugin>
<artifactId>maven-war-plugin</artifactId>
<...
1
vote
1
answer
955
views
Why is maven-war-plugin ignoring my configured filters for web resources?
I have a filter file in src/main/filters/base.properties with contents:
testProperty=testValue
My POM has resources, filtering, and additional web resources defined (using maven-war-plugin). It also ...
0
votes
0
answers
616
views
Selecting single plugin execution for creating WAR file using maven-war-plugin
I would like to execute commands that will allow to build WAR files depending on execution id
My original WAR file is generated with a lot of submodules. If I need to test and build for testing only ...
0
votes
0
answers
2k
views
Use Maven ${project.version} in web.xml servlet-mapping in Eclipse WTP
Edited to clarify that I'm asking for a solution for Eclipse WTP with Tomcat.
I have since got this to work for WAR artifacts by just using the variable ${project.version} in web.xml in conjunction ...
2
votes
0
answers
456
views
Maven execute plugin just before creating war but after archiving classes
My main problem is I have to sign all the JARs of WEB-INF\lib folder.
So this is what I have done:-
Enabled archiveClasses option to package classes also into JAR
Added JAR-Signer Plugin and setting ...