0

同事们,我有一个创建胖罐的 POM:

<properties>
        <java.version>1.8</java.version>
        <jdk.version>1.8</jdk.version>
        <spring.version>4.2.2.RELEASE</spring.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>



    <dependencies>


        <!-- Spring framework -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>4.2.3.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>4.2.3.RELEASE</version>
        </dependency>


        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
        </dependency>

        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>

        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.5.1</version>
        </dependency>



        <dependency>
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
            <version>2.11.0</version>
        </dependency>



    </dependencies>

    <build>


        <plugins>


            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>${jdk.version}</source>
                    <target>${jdk.version}</target>
                    <encoding>UTF-8</encoding>
                </configuration>
            </plugin>


            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19</version>
                    <executions>
                    <execution>
                        <goals>
                            <goal>test</goal>
                        </goals>
                    </execution>
                </executions>


                <dependencies>
                    <dependency>
                        <groupId>org.apache.maven.surefire</groupId>
                        <artifactId>surefire-junit47</artifactId>
                        <version>2.19</version>
                    </dependency>
                </dependencies>

                <configuration>
                    <includes>
                        <include>AdapterAppTest.java</include>
                    </includes>
                </configuration>
            </plugin>



            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <configuration>
                <!-- TODO исключить ряд библиотек  -->
                <appendAssemblyId>false</appendAssemblyId>
                    <archive>
                        <manifest>
                            <mainClass>com.comp.adapter</mainClass>
                        </manifest>
                    </archive>
                     <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs> 
                </configuration>
            </plugin>



        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
             <executions>
                <execution>
                    <id>attach-javadocs</id>
                    <phase>prepare-package</phase>
                    <goals>
                        <goal>javadoc</goal>
                    </goals>
                    <configuration>
                        <excludePackageNames>com.comp.entities</excludePackageNames>
                        <additionalparam>-Xdoclint:none</additionalparam> 
                        <reportOutputDirectory>${project.build.directory}/classes/</reportOutputDirectory>
                    </configuration>
                </execution>
            </executions> 
        </plugin>

        </plugins>
    </build>

结果,我在文件夹 \target\classes\apidocs 中有 fat jar 和 javadoс 描述。之后,我将这个胖 jar 添加到新项目(添加外部 Jar)中,但是在使用方法时我没有看到方法描述。为什么以及我做错了什么?

更新

日食

更新 2 jar 中没有 *.java 文件。

4

0 回答 0