Questions tagged [maven-3]

Apache Maven is a tool for project management and build automation. This tag is for questions relating to Maven version 3.x. For non version-specific questions, please use the [maven] tag.

Apache Maven is a tool for project management and build automation. Maven relies on a pom.xml file that describes the project instead of defining a set of tasks, like Ant does.

A basic pom.xml looks like:

<project>
  <!-- model version is always 4.0.0 for Maven 2 and Maven 3 POMs -->
  <modelVersion>4.0.0</modelVersion>

  <!-- A project is identified by its groupId, artifactId and version -->
  <groupId>com.mycompany.app</groupId>
  <artifactId>my-app</artifactId>
  <version>1.0</version>

  <!-- Dependencies -->
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.8.1</version>
      <!--
           The scope allows you to limit the usage of this dependency.
           In this case, this library will only be used for tests purposes.
      -->
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>

Many plugins exist, and offer more functionalities to the tool.


For non version-specific questions, please use , for the older maven versions 2.x or the legacy 1.x use or , respectively.

If you see questions related to a specific Maven plugin, please also check whether the related plugin tag is present (i.e. , ).

Questions related to Maven plugin development should also have the , while questions related to Maven profiles should also have the tag and questions related to Maven archetypes should also have the tag.

5199 questions
2
votes
2 answers

Docker agent volume mount in Jenkins pipeline not working as expected

Following snippet with volume mount creates the maven dependencies under $JENKINS_HOME/workspace//? (Question Mark) instead of under $HOME/.m2/ Note that settings.xml mirror to our internal repository. And the instructions on how to…
Samir Shaik
  • 1,000
  • 1
  • 14
  • 21
2
votes
2 answers

what is command "mvnyjp" in maven for? when to use it?

there are three commands in maven/bin: mvn mvnDebug mvnyjp I just find nothing about "mvnyjp". How and when to use it?
guofei
  • 63
  • 4
2
votes
4 answers

Chaining Maven Flyway commands

How can Flyway commands be chained into a single command using Maven? For example, I want to run mvn initialize flyway:clean followed by mvn initialize compile flyway:migrate. However, mvn initialize flyway:clean compile flyway:migrate…
Donald T
  • 10,234
  • 17
  • 63
  • 91
2
votes
1 answer

maven 3.8.0 :testCompile (default-testCompile) on project App: Fatal error compiling: invalid flag: --release -> [Help 1]

I am using jdk 11 with maven 3.8.0. please find below given pom.xml. i am getting error Fatal error compiling: invalid flag: --release -> [Help 1] Any suggestions on how to fix this?
Arun Kumar
  • 340
  • 2
  • 15
2
votes
4 answers

Maven throws error: No plugin found for prefix 'assembly' in the current project and in the plugin groups

This is my first time working with Maven and am attempting to set up this project. First, I downloaded Maven 3.6.1 and set it up (JDK version: 1.8.0). When I do : mvn -version I get this: Apache Maven 3.5.2…
Suleka_28
  • 2,761
  • 4
  • 27
  • 43
2
votes
2 answers

Project build error: 'dependencies.dependency.version' for com.amazonaws:aws-java-sdk-secretsmanager:jar is missing

In my pom.xml in section,I have added following dependency: com.amazonaws aws-java-sdk-bom 1.11.95 pom
javaguy
  • 927
  • 2
  • 16
  • 37
2
votes
2 answers

How to halt the maven build if a release build for the same snapshot version is available in the repository?

Is there any plugin available in the community or I need to build one?
Chxk
  • 47
  • 10
2
votes
2 answers

How can I debug maven dependency problems when mvn dependency-tree doesn't work?

I am trying to figure out why IntelliJ is using the wrong version (8.1.1 instead of 8.1.2) of one of my project's Java files. The IntelliJ project is a maven project with many dependencies. To debug, I tried to use the following from the command…
kc2001
  • 5,008
  • 4
  • 51
  • 92
2
votes
0 answers

Is it possible to resolve properties defined in an imported pom?

Given an imported pom: foo.fighter managed-deps 1.0 import pom Is it possible to resolve properties defined in the…
Gabriel Bauman
  • 2,270
  • 1
  • 22
  • 36
2
votes
3 answers

Maven local repo in a common global directory for multiple parallel execution

I have a machine in which multiple parallel maven execution happen. Each execution executes the below command in a separate workspace directory mvn -f main/pom.xml clean package -DskipTests -T 6 Can someone let me know should I use a separate maven…
tuk
  • 5,941
  • 14
  • 79
  • 162
2
votes
1 answer

Java heap space on deploying with flex-plugin

I have one flex project in maven. I am able to package and install it without any problems, but I am not able to deploy it: [ERROR] Java heap space -> [Help 1] java.lang.OutOfMemoryError: Java heap space at…
Chupacabras
  • 392
  • 1
  • 5
  • 20
2
votes
1 answer

maven print phase of the lifecycle during build

How to print which phase running while maven builds the project ? Let us say I run mvn install , then what I see is : [INFO] --- jacoco-maven-plugin:0.8.3:prepare-agent (default-prepare-agent) @ site-order-parent --- [INFO] argLine set to…
Number945
  • 4,631
  • 8
  • 45
  • 83
2
votes
2 answers

Concurrency issue while running Maven on Jenkins host

I regularly suffer from corrupted maven-metadata-local.xml files on my Jenkins host in directory /home/jenkins/.m2/.../some-project/ E.g. extra lines added to the end of the maven-metadata-local.xml file like this: ... …
Frizz
  • 2,524
  • 6
  • 31
  • 45
2
votes
1 answer

How do I speed up the Maven clean install? Taking 2 hours to complete

Im currently having a problem that I believe is Maven. For an university project, we are requiered to use intelliJ IDEA, java SDK, Apache Maven and Isis. I tried to follow the tutorial for Isis, creating a project, paste the arquetype on the…
Dreston
  • 21
  • 1
  • 2
2
votes
2 answers

Maven not cleaning child project target folder

I set up a sample project to understand the clean plugin in maven as to how it cleans a child project when the mvn clean:clean is run from the parent project location. Somehow, I see that maven deletes target of parent project but not of child…
Number945
  • 4,631
  • 8
  • 45
  • 83