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
1 answer

Since MavenProject.getDependencyArtifacts() is deprecated how to get direct dependencies?

The class MavenProject has the method getDependencyArtifacts() that returns all projects direct dependencies, but it was deprecated. This class also has the method getArtifacts() that returns all project's dependencies including the transitive…
Cristiano
  • 1,414
  • 15
  • 22
2
votes
1 answer

Maven - POM for is missing, no dependency information available

I am converting a 10+ years old java project to Maven project. First I mapped all the publicy available libraries and created a POM. I then converted my local copy of the project to Maven and added the dependecies to the POM. Made some adjustments…
Estevao Santiago
  • 793
  • 2
  • 7
  • 30
2
votes
1 answer

How to obtain the artifactId of the pom (bom) listed in a maven project dependencyManagement block

I am working on a maven lifecycle extension class and have need to examine the coordinate details of the pom (bom) listed in a given project's dependencyManagement block. I need to be able to do this in the afterProjectsRead method i am overriding…
ajm01
  • 31
  • 3
2
votes
0 answers

maven generated pom.properties file add date property

Interested to know if it's possible to amend the pom.properties file created by maven to include the date as a property it currently looks like: #Generated by Maven #Thu Jul 26 15:13:53 BST 2018 version=3.2 groupId=com.blah.blah artifactId=example
AkinW
  • 143
  • 10
2
votes
0 answers

mvn test fails, but mvn test -e pass all tests

I am running maven test goal in IntelliJIDEA with a set of JUnit tests. If I execute a goal in maven tab by clicking the goal one test fails. >mvn test -e Tests run: 74, Failures: 0, Errors: 0, Skipped: 0 If I double click maven test (surefire…
Stepan
  • 1,391
  • 18
  • 40
2
votes
0 answers

Order of resource directories in Maven

I would like to have my Java project using Maven set up so that when developing locally and when running unit tests, resources are taken from the standard src/main/resources and src/test/resources directories, while when applying a profile the…
user180940
  • 324
  • 1
  • 18
2
votes
1 answer

Can I force Maven to verify downloaded jars?

I'm having a lot of problems lately with Maven 3.5.0 downloading corrupted JARs. I don't know why, it could be a problem with my workplace's network, the repos we use, or just my computer. Anyway, usually it's easy to solve them, I just need to…
AJPerez
  • 3,435
  • 10
  • 61
  • 91
2
votes
1 answer

Spring-Boot: How can we remove some dependencies from Effective pom?

I am using spring-boot 2.0.3.RELEASE. When I am clicking on "show Effective POM" option by using IntelliJ IDEA, it loads Effective POM. And there I can see a few dependencies that my client don't want to have at there side. Is there any way to tell…
Ashish Pancholi
  • 4,569
  • 13
  • 50
  • 88
2
votes
2 answers

Is there a way to tell why a maven dependency is at a certain version

I have a spring boot app (which has a parent pom) and generally manages plenty of dependencies in terms of their version. If I add this to my pom.xml com.amazonaws
David
  • 7,652
  • 21
  • 60
  • 98
2
votes
1 answer

Spring Boot 2.0.3 integration test using MAVEN - java.lang.NoClassDefFoundError: org springframework boot autoconfigure jdbc DataSourceBuilder

I have a project which is setup in Eclipse(STS). When running spring integration tests using junit within eclipse, the spring context starts up correctly and the tests execute correctly. When attempting to run the tests from maven I receive this…
davisg1
  • 19
  • 3
2
votes
2 answers

How to exclude the parent pom dependency inside inherited child dependency for Maven?

I have a Jackson with version 2.3 in the parent pom and in my child pom I require version 2.9, is there any way to exclude the parent pom dependency?
Sushil Ks
  • 403
  • 2
  • 10
  • 18
2
votes
0 answers

How to Autowire EntityManager of one project to another project

I have Controllers, Services and DAOs in separate spring boot modules. I tried calling a stored procedure from DAO module using JPA API StoredProcedureQuery method, for that I need to autowire EntityManager. This set up works if I run DAO alone as a…
Indrajith K V
  • 197
  • 1
  • 1
  • 8
2
votes
1 answer

(cmake-compile) on project hadoop-common: make failed with error code 2

i am trying to compile Hadoop from source and i get this error and i don't know what is the problem or how to solve it . i installed all the Requirements that are needed as the instructions says : …
Mohamed Adam
  • 23
  • 1
  • 4
2
votes
2 answers

Eclipse Photon + Maven + Log4j2 (getting error Module log4j.api not found, required by xxx)

I downloaded eclipse photon and tried to run very basic example with log4j2. Here is my configuration Project structure Here is the module path screen shot POM.xml 10
Basit
  • 8,426
  • 46
  • 116
  • 196
2
votes
2 answers

Maven not downloading jars behind proxy

Maven is unable to download jar (s) (Dependency) behind proxy. Here is my pom.xml
Faizan Mubasher
  • 4,427
  • 11
  • 45
  • 81
1 2 3
99
100