如何使用命令行的源安装Maven工件? [英] How to install Maven artifact with sources from command line?

查看:164
本文介绍了如何使用命令行的源安装Maven工件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



所以后来我不需要在eclipse中打开一个项目来查看一些代码。



编辑:
我知道我可以添加到pom.xml这个代码

 <插件> 
< artifactId> maven-source-plugin< / artifactId>
<执行>
< execution>
< id> attach-sources< / id>
< phase> verify< / phase>
< goals>
< goal> jar< / goal>
< / goals>
< / execution>
< / executions>
< / plugin>

但是我想从命令行(让它更通用) >

解决方案

下载来源的依赖关系:

  mvn eclipse:eclipse -DdownloadSources = true 

将源附加到安装:

  mvn source:jar install 

还可以使用 source:jar-no-fork 。 apache.org/plugins/maven-source-plugin/usage.htmlrel =noreferrer> maven-source-plugin 页面。


How to install Maven artifact with sources?

so later I don't need to open a project in eclipse to see some code.

EDIT: I do know I can add to pom.xml this code

<plugin>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
                <execution>
                        <id>attach-sources</id>
                        <phase>verify</phase>
                        <goals>
                                <goal>jar</goal>
                        </goals>
                </execution>
        </executions>
</plugin>

but I would like to do it from command line(to make it more universal).

解决方案

To download sources for your dependencies:

mvn eclipse:eclipse -DdownloadSources=true

To attach sources to an installation:

mvn source:jar install

It's also preferable to use the goal source:jar-no-fork in your pom as described on the maven-source-plugin page.

这篇关于如何使用命令行的源安装Maven工件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆