How to build a jar using Maven?
I want to build my project with Maven. How do I do that?
Maven is instal开发者_Go百科led,
the project is called Sertsu1
it contains a pom.xml-file
What must be entered in the command line to start building?
If your project is organized as Maven expects, e.g. your source code is in the src\main\java
directory you can run
mvn package
to just build your jar
mvn install
to install it in your local Maven repository
mvn clean
to remove a previous build
Beware that you won't go very far with Maven without reading about it. You can start with this book.
In order to create an artifact (jar-file) you need to invoke
mvn package
This is very basic and you should take your time to read the suggested manuals before using maven.
Navigate to the folder that contains the pom.xml
and enter
mvn package
(for a quick result)
Your machine needs to be connected to the internet as maven will download a lot of files from public repositories.
精彩评论