打包资源文件
默认资源文件不会被打包到jar,需要在pom.xml中配置
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**</include>
</includes>
</resource>
</resources>
</build>
打包源码
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
查看jar包源码时乱码
eclipse workspace的文件默认编码和源码的编码保持相同,修改方法:window--preferences,搜索workspace,修改text file encoding。