加载源类时,Maven执行插件ClassNotFoundException

时间:2018-07-13 14:06:09

标签: java maven exec-maven-plugin

我想生成一种特殊的文档。我遍历所有包和类,并通过反思来解析它们。我有一个单独的应用程序可以运行,但是现在,我将其合并到了更大的应用程序中,但是我收到了很多ClassNotFoundException。 我添加了这两条建议 **** includeProjectDependencies includePluginDependencies ****

<profiles>
    <profile>
        <id>documentation-generator</id>
        <dependencies>
         ...... 
        </dependencies>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>exec-maven-plugin</artifactId>
                    <version>1.6.0</version>
                    <executions>
                        <execution>
                            <goals>
                                <goal>java</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>                      
                        <addResourcesToClasspath>true</addResourcesToClasspath>
                        <additionalClasspathElements>true</additionalClasspathElements>
                        <includeProjectDependencies>true</includeProjectDependencies>
                        <includePluginDependencies>true</includePluginDependencies>
                        <includeProjectDependencies>true</includeProjectDependencies>
                        <mainClass>XXXXXX.Main</mainClass>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>

0 个答案:

没有答案