如果引入的依赖库没有源码,Ideal会使用反编译插件对.class文件反编译
要手动查找类,比如:反编译后的文件可以看接口,不能看实现
如果选择Choose Sources时选中了jar包,可能会提示
IDEA cannot determine what kind of files the chosen items contain. Do you want to attach them as 'Sources'?
如果依赖库有源码,会在maven库同路径下,有**source.jar文件,上面Choose Sources选中的也是source包,而不是依赖包
源码打包的方法,pom文件中添加
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-archetype-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>