我有一个使用struts 1和扭矩的遗留应用程序。我上周已经做了一些努力来重构它并试图解耦一些类的组并引入单元测试。由于我无法通过单元测试来测试应用程序的所有区域,因此我想添加HtmlUnit测试。
为此,我将maven-failsafe-plugin和jetty添加到我的项目中,如下所示:
<build>
...
<plugins>
...
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.16</version>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<stopPort>8005</stopPort>
<stopKey>STOP</stopKey>
<contextPath>/</contextPath>
</configuration>
<executions>
<execution>
<id>start-jetty</id>
<phase>pre-integration-test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<scanIntervalSeconds>0</scanIntervalSeconds>
<daemon>true</daemon>
</configuration>
</execution>
<execution>
<id>stop-jetty</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
问题是,当我运行mvn verify时,我得到以下异常:
java.lang.SecurityException: sealing violation: can't seal package javax.naming: already loaded
我在某些类中使用javax.naming,但找不到覆盖javax.naming的任何依赖项!
有没有人知道如何解决这个问题?