Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 带有ClassNotFoundException的Exec Maven插件_Java_Maven_Exec Maven Plugin - Fatal编程技术网

Java 带有ClassNotFoundException的Exec Maven插件

Java 带有ClassNotFoundException的Exec Maven插件,java,maven,exec-maven-plugin,Java,Maven,Exec Maven Plugin,我有一个多模块(模型和服务模块)maven项目: model |_____ABCEntity.java service |_____pom.xml <dependency>model</dependency> <dependency>code-generation</dependency> <plugin> <groupId>org.codehaus.mojo</

我有一个多模块(模型和服务模块)maven项目:

model
|_____ABCEntity.java
service
|_____pom.xml
      <dependency>model</dependency>
      <dependency>code-generation</dependency>
      <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <configuration>
            <mainClass>com.codegenerator.CodeGeneratorApplication</mainClass>
          </configuration>
      </plugin>
有人能帮我吗?我不明白为什么找不到厌度,因为: 1) ABCEntity在同一个项目中,但在另一个模块中 2) 我已经声明了对该模块的依赖关系。

您可以访问


你的群组ID
>模型
com.codegenerator.codegenerator应用程序

似乎一旦我使用了这个插件的另一个目标(我只执行mvn exec:exec),就可以找到以下缺点:

            <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.6.0</version>
            <configuration>
                <executable>java</executable>
                <arguments>
                    <argument>-classpath</argument>
                    <!-- automatically creates the classpath using all project dependencies, 
                        also adding the project build directory -->
                    <classpath />
                    <argument>codegenerator.CodeGeneratorApplication</argument>
                    ...
                </arguments>
            </configuration>

        </plugin>

org.codehaus.mojo
execmaven插件
1.6.0
爪哇
-类路径
codegenerator.codegenerator应用程序
...
但我不确定背后的真正原因

<executableDependency>
    <groupId>your groupId</groupId>
    <artifactId>>model</artifactId>
</executableDependency>
<mainClass>com.codegenerator.CodeGeneratorApplication</mainClass>
            <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.6.0</version>
            <configuration>
                <executable>java</executable>
                <arguments>
                    <argument>-classpath</argument>
                    <!-- automatically creates the classpath using all project dependencies, 
                        also adding the project build directory -->
                    <classpath />
                    <argument>codegenerator.CodeGeneratorApplication</argument>
                    ...
                </arguments>
            </configuration>

        </plugin>