如何将java类从测试包添加到maven插件
我想将一个java类从测试包添加到如何将java类从测试包添加到maven插件,java,maven,exec-maven-plugin,Java,Maven,Exec Maven Plugin,我想将一个java类从测试包添加到execmaven pluginexecution 正如你所看到的,我试过使用贝娄: <classpathScope>test</classpathScope> 测试 找不到我的测试资源 <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-
execmaven plugin
execution
正如你所看到的,我试过使用贝娄:
<classpathScope>test</classpathScope>
测试
找不到我的测试资源
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>generateIgniteSchemaClasses</id>
<phase>process-test-resources</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<executableDependency>
<groupId>com.package</groupId>
<artifactId>ignite-schema-import</artifactId>
</executableDependency>
<mainClass>com.package.SchemaImportApplication</mainClass>
<arguments>
<argument>${project.build.testOutputDirectory}/xml/schema.xml</argument>
</arguments>
<classpathScope>test</classpathScope>
</configuration>
</execution>
</executions>
</plugin>
org.codehaus.mojo
execmaven插件
生成gniteschemaclasses
过程测试资源
JAVA
com.package
点燃模式导入
com.package.SchemaImportApplication
${project.build.testOutputDirectory}/xml/schema.xml
测试
为了让执行通过,我需要一个来自testcom.package
测试资源是类执行中所需的测试注释类型接口。在解决方案中进行了更多研究后,我得出结论,最好在项目中创建一个新的测试模块
<build>
<plugins>
<!-- This is a test module, so it does not need to be deployed -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
org.apache.maven.plugins
maven部署插件
真的
我在上面的模块中添加了它作为测试资源:
<dependency>
<groupId>com.project</groupId>
<artifactId>project-test-module</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
com.project
项目测试模块
${project.version}
测试