如何使用源代码安装 Maven Artifact ?
所以以后我不需要在eclipse中打开一个项目来查看一些代码。
编辑: 我知道我可以将这段代码添加到 pom.xml 中
<plugin>
<artifactId>maven-source-plugin</artifactId>
<executions>
<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
最好在你的 pom 中使用目标 source:jar-no-fork
,如 maven-source-plugin 中所述。页面。
关于java - 如何使用命令行源安装 Maven Artifact ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5102571/