使用glassfish-embedded-all和arquillian-glassfish-embedded-3.1工件执行maven安装时出错

JPC*_*PCF 5 glassfish java-ee maven glassfish-embedded jboss-arquillian

我正在尝试maven install在pom 上执行,结果显示:

坟墓:SEC5054:证书已过期

测试执行开始后就会出现此结果.我一直在谷歌搜索这个问题,但我只找到了与真正的glassfish应用服务器相关的解决方案.他们建议从他们所在的文件夹中删除违规证书等等(我看到的页面大多是这样的)或者"unjar"glassfish-embedded来删除认证,然后再次将其打包.

请注意,我正在执行maven install应用程序服务器上的实际部署,而不是实际部署.这就是为什么我不能接受许多博客给出的建议

pom包含以下依赖项:

 <dependencies>
<dependency>
  <groupId>org.glassfish.main.extras</groupId>
  <artifactId>glassfish-embedded-all</artifactId>
  <version>3.1.2.2</version>
  <scope>provided</scope>
</dependency>
<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>4.10</version>
  <scope>test</scope>
  <optional>true</optional>
</dependency>
<dependency>
  <groupId>org.jboss.arquillian.junit</groupId>
  <artifactId>arquillian-junit-container</artifactId>
  <version>1.0.0.Final</version>
  <scope>test</scope>
</dependency>
<dependency>
  <groupId>org.jboss.arquillian.container</groupId>
  <artifactId>arquillian-glassfish-embedded-3.1</artifactId>
  <version>1.0.0.CR3</version>
  <scope>test</scope>
</dependency>
Run Code Online (Sandbox Code Playgroud)

xwo*_*ker 1

这是至少自 Glassfish 3.0.1 以来的一个已知问题,并且在 Glassfish 3.1.2 中仍被报告为开放问题。Oracle 提供了一些解决方法 - 但这些方法并不适用于您的情况。但他们也说:

如果实例未按此方式配置,请忽略该警告。实例的功能不受影响。

因此,即使这是对一个问题的蹩脚答案:不要为你的测试用例而烦恼。(我个人花了很多时间试图解决这个问题。)新版本的 Glassfish 要么会为我们解决这个问题,要么不会。我们别再打扰了。

更新:

如果您遇到触发构建失败的问题,以下 pom 适用于我,而不会导致构建失败:

<!--snip-->
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.jboss.arquillian</groupId>
            <artifactId>arquillian-bom</artifactId>
            <version>1.0.3.Final</version>
            <scope>import</scope>
            <type>pom</type>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
    <dependency>
        <groupId>org.glassfish.main.extras</groupId>
        <artifactId>glassfish-embedded-all</artifactId>
        <version>3.1.2</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.jboss.arquillian.container</groupId>
        <artifactId>arquillian-glassfish-embedded-3.1</artifactId>
        <version>1.0.0.CR4</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.jboss.arquillian.junit</groupId>
        <artifactId>arquillian-junit-container</artifactId>
        <version>1.1.1.Final</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>org.apache.derby</groupId>
        <artifactId>derbyclient</artifactId>
        <version>10.7.1.1</version>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>
    </plugins>
</build>
Run Code Online (Sandbox Code Playgroud)