【问题标题】:Is there a way for maven script to automatically download dependent jars of dependencies i specify in a pommaven脚本有没有办法自动下载我在pom中指定的依赖jar
【发布时间】:2013-07-04 14:19:59
【问题描述】:

maven 脚本有没有办法自动下载我在 pom 中指定的依赖 jar 包?

例如,我在 pom.xml 中指定以下内容,

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>3.2.3.RELEASE</version>
</dependency>

我想要一个工具来解决“spring-core”所依赖的任何依赖项,并更新 pom 以及下载的依赖项。 任何 ide 的/构建插件可以做到这一点?

【问题讨论】:

    标签: maven build dependencies


    【解决方案1】:
    Yes you can download from MAVEN Central repository by specifying central repository location in your maven home. ie .m2/settings.xml
    
    <mirror>
           <id>mirrors.dotsrc.org</id>
           <name>Mirror of http://repo1.maven.org/maven2/</name>
           <url>http://repo1.maven.org/maven2/</url>
           <mirrorOf>central2</mirrorOf>
    </mirror>
    
    and in your pom add following..
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>3.2.3.RELEASE</version>
    
    Please refer.
    http://search.maven.org/#search|ga|1|g%3A%22org.springframework%22
    

    【讨论】:

    • 这会自动下载 Spring 依赖的 jars 吗?
    猜你喜欢
    • 2020-01-24
    • 1970-01-01
    • 1970-01-01
    • 2015-01-22
    • 1970-01-01
    • 1970-01-01
    • 2019-01-13
    • 1970-01-01
    • 2020-04-30
    相关资源
    最近更新 更多