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
3 answers

How to setup a maven project using fop and java-11?

When I set up a maven project using Apache fop and Java 11 I get warnings and a NullPointerException with maven-compiler-plugin 3.8.0. The used archetype is working fine with Java 11 to quickly create a desktop application, but only if I do not add…
ngong
  • 754
  • 1
  • 8
  • 23
2
votes
1 answer

How to exclude java.activation?

module-info.java in the various projects which comprise a working JAXB include: requires transitive jakarta.activation; For example, https://github.com/eclipse-ee4j/jaxb-ri/blob/master/jaxb-ri/runtime/impl/src/main/java/module-info.java#L23 But…
JasonPlutext
  • 15,352
  • 4
  • 44
  • 84
2
votes
0 answers

Using Maven install and deploy upload airtifact to nexus

We need to upload artifacts to nexus with out including time stamp. We are using maven3 for compilation. We have use -DuniqueVersion=false goal, but it is not working. Is there any way to fulfil this requirement ?
Michael
  • 69
  • 6
2
votes
1 answer

Maven multi-module - build only a sub-module

I have a multi-module project P with sub-modules A, B and C. A is dependent on B. B is dependent on C. With B and C neither available in remote or local repos, is it possible to build from A's directory passing the relative path to dependent modules…
l a s
  • 3,836
  • 10
  • 42
  • 61
2
votes
0 answers

Maven remote archetype from Nexus offers all snapshots instead of only the last one

I have generated a Maven archetype which has been uploaded to a Nexus repository (mvn deploy). This archetype is still a SNAPSHOT. When I try to generate a project mvn archetype:generate -DarchetypeCatalog=remote -U I am offered every uploaded…
codependent
  • 23,193
  • 31
  • 166
  • 308
2
votes
1 answer

does a project inherit dependencyManagement from dependency's parent

project A depends on project B. project B has parent C. C defines dependencyManagement section. Does A get dependencyManagement from C? Or does C's dependencyManagment section have no impact on project A?
B.Z.
  • 418
  • 5
  • 12
2
votes
1 answer

PMD - Java 8 - Law of demeter

I use PMD plugin in my Maven project to verify code violations and standards. In Java-8, the PMD complains the below code as Potential violation of Law of Demeter. Arrays.asList(1, 2, 3, 4).stream().filter(n -> n % 2 ==…
vvra
  • 2,832
  • 5
  • 38
  • 82
2
votes
1 answer

Azure DevOps Maven Docker build - can't locate target folder

I am new to Azure Devops and am having some difficulty building my first pipeline. So far I have three steps that work just fine: Maven build from POM, successfully packages my war file Copy files to $(system.defaultworkingdirectory), copying the…
BigTFromAZ
  • 684
  • 7
  • 22
2
votes
2 answers

How to force m2eclipse to look for new dependencies after network outage?

we are using m2eclipse 0.12.1 together with nexus oss 1.9.0.1 repository. Today, during a downtime of the nexus server, some user did use "update dependencies" in m2eclipse, which did result in a broken project configuration (artifact not found ...…
mglauche
  • 3,344
  • 4
  • 28
  • 31
2
votes
1 answer

Maven 3, maven-site-plugin, how to configure reportPlugins in a multi-module project

With Maven 3, the site plugin has changed regarding reporting. In the maven 2, the reporting section had the an "inherited" element. For example: org.apache.maven.plugins
Travis Schneeberger
  • 2,010
  • 20
  • 23
2
votes
2 answers

Copy a folder from one module to other module in Maven

Project structure -MyProject |_ project1 |_ dist |_ app |_ config |_ pom.xml |_ project2 |_ pom.xml I tried another way as below, but didn't work.
Bhargav Teja
  • 431
  • 6
  • 19
2
votes
1 answer

Why can't I get a test resources on travis or circle CI environments?

I'm facing a very annoying issue while trying to run my project's junit tests inside a remote CI environment. In my local machine with java 1.8.0_181 and maven 3.5.4 I don't have any problem. I used to use the two ways bellow to get a test…
Cristiano
  • 1,414
  • 15
  • 22
2
votes
3 answers

jar-with-dependencies Maven Assembly

I created a simple Maven project (Packaging type - Jar) that has dependencies on Spring and My Sql library (mysql-connector). When I package this project with $mvn package I do get a jar file after successful execution of this command. I was also…
Vicky
  • 5,380
  • 18
  • 60
  • 83
2
votes
0 answers

How to find out the latest jar dependency available in artifactory?

How to find out the latest jar dependency available in artifactory by JFrog based on GroupId and ArtifactId. For example: The below dependency is the latest available .But how the value 5.1.0.RELEASE can be obtained through code?
soumitra chatterjee
  • 2,268
  • 9
  • 26
  • 48
2
votes
2 answers

When I use Jmeter 5.0 and Jmeter Maven Plugin 2.7 together, it doesn't generate JTL file by default

My Jmeter test plan has two threads. Each thread uses different CSV file, runs separate test. I am expecting it to generate two JTL files at the end of execution. In order to achieve this I have added separate Aggregate Table listener to each thread…
paul
  • 4,333
  • 16
  • 71
  • 144
1 2 3
99
100