java - Arquillian 测试的“包不存在”
问题描述
对于我的 Java 应用程序,有一些函数是从 wsdl 文件下载的,并放在名为 java_DVLP 的文件夹中用于开发,而 java_PROD 则用于生产。这是通过我的 pom.xml 文件中的以下代码完成的:
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>3.4.2</version>
<executions>
<execution>
<id>CTIE.GU</id>
<phase>generate-sources</phase>
<configuration>
<sourceRoot>src/main/java_${classifier}</sourceRoot>
<wsdlOptions>
<wsdlOption>
<wsdl>${guCodeUrl}</wsdl>
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
创建的文件夹通过以下方式添加:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<phase>generate-test-sources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/java_DVLP</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
这工作正常。
我如何创建 Arquilian 测试以及尝试执行它们时 maven 告诉我:
Caused by: org.jboss.shrinkwrap.resolver.api.maven.archive.importer.MavenImporterException: Unable to compile sources at C:\java\dev\gitroot\pdv\src\main\java due to following reason(s): /C:/java/dev/gitroot/pdv/src/main/java/lu/etat/pch/pdv/jsf/beans/myGuichet/myGuichetServlet.java:[3,40] package lu.etat.cie.fp.gun.core.appli.ws does not exist, /C:/java/dev/gitroot/pdv/src/main/java/lu/etat/pch/pdv/jsf/beans/myGuichet/myGuichetServlet.java:[4,40] package lu.etat.cie.fp.gun.core.appli.ws does not exist, /C:/java/dev/gitroot/pdv/src/main/java/lu/etat/pch/pdv/jsf/beans/myGuichet/myGuichetServlet.java:[6,40] package lu.etat.cie.fp.gun.core.appli.ws does not exist, /C:/java/dev/gitroot/pdv/src/main/java/lu/etat/pch/pdv/jsf/beans/action/PdvImportBean.java:[11,1] package lu.etat.cie.fp.gun.core.appli.ws does not exist, /C:/java/dev/gitroot/pdv/src/main/java/lu/etat/pch/pdv/jsf/beans/myGuichet/main.java:[3,1] package lu.etat.cie.fp.gun.core.appli.ws does not exist
未找到的包 lu.etat.cie.fp.gun.core.appli.ws 是我从 wsdl 文件中获得的包。但是这些文件存在于 target/test-classes 文件夹中。我不知道为什么我可以部署我的程序,但是由于找不到包,测试失败了。
有人可以指导我吗?
提前致谢。
解决方案
推荐阅读
- java - 未检测到 Java KeyPress
- .net - ASP.NET MVC - 不能在 Foreach 循环中使用 HTML Raw
- json - 反序列化 JSON swift 4.2
- ios - 我们是否应该使用观察者方法来修改 IBOutlet 属性
- javascript - Javascript类方法绑定不起作用
- javascript - 如何将新文档应用于旧版缩小文件?
- xml - 将 XML 文件保存到 HDFS
- vb.net - 空条件运算符不起作用(显示“调用不是 xxx 的成员”)
- sql - 如果行不符合要求,如何分配值 0
- web - 有关 Microsoft Power BI Embedded 的一般问题