有人知道是否可以在Maven存储库中找到源jar吗?
当前回答
你可以,如果他们被上传。通常它们被称为“frameworkname-version-source(s)”
其他回答
Maven Micro-Tip: Get sources and Javadocs When you're using Maven in an IDE you often find the need for your IDE to resolve source code and Javadocs for your library dependencies. There's an easy way to accomplish that goal. mvn dependency:sources mvn dependency:resolve -Dclassifier=javadoc The first command will attempt to download source code for each of the dependencies in your pom file. The second command will attempt to download the Javadocs. Maven is at the mercy of the library packagers here. So some of them won't have source code packaged and many of them won't have Javadocs. In case you have a lot of dependencies it might also be a good idea to use inclusions/exclusions to get specific artifacts, the following command will for example only download the sources for the dependency with a specific artifactId: mvn dependency:sources -DincludeArtifactIds=guava
来源:http://tedwise.com/2010/01/27/maven-micro-tip-get-sources-and-javadocs/
文档:https://maven.apache.org/plugins/maven-dependency-plugin/sources-mojo.html
你可以,如果他们被上传。通常它们被称为“frameworkname-version-source(s)”
在eclipse中-点击项目然后:
.
在IntelliJ IDEA中,您可以在导入时通过打开“自动下载源”选项自动下载工件源:
设置→构建、执行、部署→构建工具→Maven→导入
NetBeans, Context-Click
在NetBeans 8的maven驱动项目中,只需上下文单击感兴趣的依赖项的jar文件列表项。选择“下载源”。稍等片刻,NetBeans将自动下载并安装源代码(如果可用的话)。
类似地,您可以选择Download Javadoc以在本地安装文档。然后,您可以在编辑器中上下文单击一些代码并选择查看JavaDoc。
推荐文章
- 如何分割逗号分隔的字符串?
- Java字符串—查看字符串是否只包含数字而不包含字母
- Mockito.any()传递带有泛型的接口
- 在IntelliJ 10.5中运行测试时,出现“NoSuchMethodError: org.hamcrest. matcher . descripbemismatch”
- 使用String.split()和多个分隔符
- Java数组有最大大小吗?
- 在Android中将字符串转换为Uri
- 从JSON生成Java类?
- 为什么java.util.Set没有get(int index)?
- Swing和AWT的区别是什么?
- 为什么Java流是一次性的?
- 四舍五入BigDecimal *总是*有两位小数点后
- 设计模式:工厂vs工厂方法vs抽象工厂
- Java:检查enum是否包含给定的字符串?
- 它的意思是:序列化类没有声明一个静态的最终serialVersionUID字段?