Adding maven dependencies

I am trying to create a basic archetype with maven, at the moment I know how to create an architecture using mvn archetype: generate, however I would like toadd dependencies in the mvn console.

Is it possible to add dependencies from the command line not from the pom file?

I would like to do this because an interesting option is to create a simple architecture with a .bat file.

+4
source share
1 answer

There is nothing in the official documentation , at least. Dependencies coming into the generated pom.xml are determined by the archetypeArtifactId parameter. For example, -DarchetypeArtifactId=maven-archetype-j2ee-simpleor -DarchetypeArtifactId=maven-archetype-webappor any other archetype

Example

, -DarchetypeArtifactId=maven-archetype-webapp pom.xml, JUnit

+1

Source: https://habr.com/ru/post/1660408/


All Articles