Skip to content

Commit 9a77b99

Browse files
committed
update java
1 parent 8fba657 commit 9a77b99

File tree

1 file changed

+0
-82
lines changed

1 file changed

+0
-82
lines changed

Java学习之路.md

Lines changed: 0 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -5439,89 +5439,7 @@ jps类似linux的ps命令,不同的是ps是用来显示进程,而jps只显
54395439

54405440
http://download.oracle.com/javase/1.5.0/docs/tooldocs/share/jps.html
54415441

5442-
# Maven相关
54435442

5444-
## maven 下载 源码和javadoc命令
5445-
5446-
Maven命令下载源码和javadocs
5447-
5448-
当在IDE中使用Maven时如果想要看引用的jar包中类的源码和javadoc需要通过maven命令下载这些源码,然后再进行引入,通过mvn命令能够容易的达到这个目的:
5449-
5450-
mvn dependency:sources
5451-
5452-
mvn dependency:resolve -Dclassifier=javadoc
5453-
5454-
命令使用方法:首先进入到相应的pom.xml目录中,然后执行以上命令:
5455-
5456-
第一个命令是尝试下载在pom.xml中依赖的文件的源代码。
5457-
5458-
第二个命令:是尝试下载对应的javadocs
5459-
5460-
但是有可能一些文件没有源代码或者javadocs
5461-
5462-
通过配置文件添加
5463-
5464-
打开maven配置文件 setting.xml文件(.../.m2/settings.xml) 增加如下配置:
5465-
5466-
<profiles>
5467-
5468-
<profile>
5469-
5470-
<id>downloadSources</id>
5471-
5472-
<properties>
5473-
5474-
<downloadSources>true</downloadSources>
5475-
5476-
<downloadJavadocs>true</downloadJavadocs>
5477-
5478-
</properties>
5479-
5480-
</profile>
5481-
5482-
</profiles>
5483-
5484-
5485-
5486-
<activeProfiles>
5487-
5488-
<activeProfile>downloadSources</activeProfile>
5489-
5490-
</activeProfiles>
5491-
5492-
配置eclipse
5493-
5494-
Window > Preferences > Maven and checking the "Download Artifact Sources" and "Download Artifact JavaDoc" options
5495-
5496-
5497-
5498-
## 杂项
5499-
5500-
间接依赖的jar包能否直接使用
5501-
5502-
如果工程依赖A.jar,并用maven设置好依赖,同时A.jar会依赖B.jar,所以maven在下载A.jar的同时会下载B.jar,这时如果项目发现需要使用B.jar中的一些内容,在maven中不必从新设置依赖,可以在工程中直接使用。
5503-
5504-
5505-
5506-
把某个本地jar包安装到本地仓库中
5507-
5508-
mvn install:install-file -DgroupId="edu.jiangxin" -DartifactId=”gcu” -Dversion="1.0.0"
5509-
5510-
-Dpackaging=”jar” -Dfile="D:\CS\J2EE\lib\edu.jiangxin.gcu-1.0.0.jar"
5511-
5512-
5513-
5514-
把某个本地jar包部署到某个远程仓库中
5515-
5516-
mvn deploy:deploy-file -DgroupId="edu.jiangxin" -DartifactId=”gcu” -Dversion="1.0.0"
5517-
5518-
-Dpackaging=”jar” -Dfile="D:\CS\J2EE\lib\edu.jiangxin.gcu-1.0.0.jar" -Durl=http://yourlocalrepository:8888/archiva/repository/internal
5519-
5520-
-DrepositoryId=internal
5521-
5522-
maven中如何生成javadoc
5523-
5524-
mvn javadoc:javadoc
55255443

55265444
# Ant相关
55275445

0 commit comments

Comments
 (0)