How to simply download a JAR using Maven?

后端 未结 12 586
轮回少年
轮回少年 2020-12-04 10:14

How do I download JAR during a build in Maven script?

12条回答
  •  攒了一身酷
    2020-12-04 10:46

    Normally you don't use Maven for "just downloading", but for your build process. So normally, you do the following steps:

    1. Define a new project by defining the archetype of your project and some needed properties.
    2. Define as a dependency the library you want to use.
    3. Run Maven with mvn compile

    As a side effect, you will have downloaded the library to your local Maven repository. There are a lot of plugins to do something with dependencies, so have e.g. a look at the Maven Dependency plugin.

提交回复
热议问题