29 questions
1
vote
1
answer
50
views
How to automatically process multiple "goals"?
I use package to have Maven generate the target JAR-file, and the dependency:build-classpath to generate the cp.txt listing all of the dependency JARs, that I don't want bundled into the target JAR:
...
0
votes
0
answers
107
views
Maven: commands of the lifecycle
Please tell me how to run the maven LifeCycle commands through Terminal?
If you write mvn clean or mvn compile, then the commands belonging to the maven plugin are run. The result of their execution ...
0
votes
1
answer
1k
views
Maven assembly plugin zips the jar.original content and not the executable jar
How to pack the executable jar in zip using maven-assembly-plugin and not the Original file i.e. .jar.original
Currently, on providing maven-assembly-plugin as dependency, it packs the jar.original in ...
74
votes
2
answers
66k
views
What is the difference between 'mvn verify' vs 'mvn test'?
I'm bit confused with mvn verify phase. I've created a Spring Boot project (a simple project, without any explicit configurations added). I've created a few JUnit unit tests which are run with both ...
0
votes
1
answer
376
views
What is the difference between mvn pre-clean / clean / post-clean?
what is the difference between these 3 commands: mvn pre-clean / clean / post-clean? Pre and post are unusual to be used. We go straight forward with mvn clean but why?
0
votes
1
answer
283
views
Maven Mojo does not utilize the reactor when called through a phase. It works fine when called as independent goal
I have implemented a custom maven mojo to perform some operation on all modules mentioned in the input POM. The mojo works as expected when called from command line like:
mvn plugin_group_id:...
0
votes
0
answers
35
views
Is maven having any life cycle to run scripts?
I want to know whether maven has different lifecycle for run scripts . please help me to know the answer to this question "Is maven having any life cycle to run scripts?"
16
votes
2
answers
8k
views
Maven lifecycle within jenkins pipeline - how to best separate responsibilities?
When working with jenkins 2 (declarative) pipelines and maven I always have a problem with how to organize things within the pipeline to make it resusable and flexible.
On the one side I would like ...
1
vote
0
answers
139
views
How to execute Maven plugins dynamically?
I am using maven-remote-resources-plugin, which retrieves the remote resources (such as css file) from another project to a specific directory in the current project. Since I am developing the css ...
0
votes
2
answers
4k
views
Unknown lifecycle phase "run". You must specify a valid lifecycle phase
[ERROR] Unknown lifecycle phase "run". You must specify a valid lifecycle phase
or a goal in the format
0
votes
0
answers
61
views
Maven Ant run something at the end of the build
I have a Maven parent project that has 6 modules, each module generates a specific artifact that is copied somewhere, when all the modules are built I want to be able to run an ant task that commits ...
0
votes
1
answer
217
views
Custom Lifecycle breaks Surefire:test in Maven
I have a plugin that creates a special zip file as part of the build process.
To do this it defines a custom packaging type 'wcc' and a custom life cycle to go with it.
When I run mvn package the ...
11
votes
1
answer
1k
views
Is it possible to resolve dependencies in maven plugin from p2 repo
I am developing one maven plugin which will be used to override the default maven lifecycles and will use my code instead. I have multiple jar dependencies (eclipse and my another application plugins) ...
1
vote
1
answer
64
views
Phase name collisions in custom lifecycles in Maven?
AFAIK, you can create a custom build lifecycle in maven.
Also, AFAIK, you cannot tell maven to execute a lifecycle. You can either:
Tell maven to execute a phase: In this case, maven finds in which ...
2
votes
1
answer
277
views
Where is the JAR packaging Maven lifecycle defined?
I'm creating a custom Maven packaging based on the lifecycle of the JAR packaging. I'd like to known where this lifecycle is defined (i.e. components.xml source code location).
18
votes
4
answers
11k
views
Adding phases to the maven lifecycle?
I try to add some additional phases to the maven lifecycle. Mainly to add some additional test levels:
<phases>
<phase>initialize</phase>
<phase>process-resources</...
0
votes
0
answers
153
views
Clean lifecycle in Travis CI Maven build
When I review .travis.yml configs I very often see mvn clean verify or mvn clean install.
Is there any point in invoking clean lifecycle in the Travis CI builds when it is first invocation of mvn in ...
0
votes
0
answers
170
views
Maven lifecycle wrong order
I deploy my application during the package phase:
<plugin>
<groupId>org.glassfish.maven.plugin</groupId>
<artifactId>maven-glassfish-plugin</artifactId>
<...
2
votes
1
answer
2k
views
Maven lifecycle understanding
I have a JavaEE, maven application. In this application I use classes generated from XSD, and mappers via Mapstruct.
In my EJB module, the maven build should do the following:
generate the java ...
2
votes
0
answers
116
views
How to create a custom lifecycle mapping to facilitate releases
I've been working with the release plugin, but am trying to automate its solution a little for our needs.
At the moment, all our builds run the following command:
mvn clean initialize release:...
0
votes
1
answer
866
views
does maven profile configured for integration phase execute during build life cycle?
Here is the condensed snippet of pom.xml from my project
<profiles>
<profile>
<id>run-tests</id>
<build>
...
-1
votes
2
answers
10k
views
How do you properly execute "mvn clean" inside a project?
I'm trying to clean, build, and package my project, but I keep getting this error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.6.1:clean (auto-clean) on project ...
19
votes
2
answers
10k
views
How to skip maven phase pre-integration-test if skipITs is set?
I have some integration tests that depend on test data. This test data is created in phase pre-integration-test and removed in phase post-integration-test.
My problem is that these phases are still ...
131
votes
7
answers
61k
views
Maven: Lifecycle vs. Phase vs. Plugin vs. Goal [closed]
Relatively new developer here, even though I've been using it for a little while, I'm hoping to solidify my Maven fundamentals. Part of my problem is that I have no experience with Ant, which seems to ...
1
vote
0
answers
52
views
Skip recompile when test single Class with Maven [duplicate]
I was writing very long time test driven code with Ant. A while ago decided to give maven a try. Now I'm very comfortable with maven, in special with dependency management.
But now I'm wondering if ...
4
votes
5
answers
6k
views
How to skip the maven antrun copy/shade:shade goal dynamically?
I am using maven for configuration of an application consisting of multiple small services. Most of the services developed in java share the same maven configuration, as in the same build lifecycle, ...
1
vote
0
answers
314
views
How to create a custom Maven packaging type with custom plugin configurations
I have created a custom packaging type foo and foo has a LifecycleMapping where it calls several plugins. Is it possible to provide default <configuration/> or pom.xml for these plugins and ...
1
vote
1
answer
7k
views
Maven enforcer plugin and missing dependencies
Here is a minimal project:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://...
2
votes
1
answer
1k
views
IntelliJ maven lifecycle - can I modify "Basic Tasks Only" list?
In the IntelliJ Maven Projects tree-view pane, you can see the Lifecycle tasks for all of the maven modules.
By default, these show "Basic Tasks Only". I can untick this, but then I see everything.......