java - 由于 "Negative seek offset",Cargo Maven 插件无法下载和解压 Jetty zip

标签 java maven jetty maven-cargo

  1. 我在运行集成测试时遇到以下错误:

    Failed to execute goal org.codehaus.cargo:cargo-maven2- 
    plugin:1.1.3:start (start-container) on project <project-name>:
    Execution start-container of goal org.codehaus.cargo:cargo-maven2-
    plugin:1.1.3:start failed: Error while expanding 
    <project>/target/downloads/jetty-6.1.26.zip
    [ERROR] java.io.IOException: Negative seek offset
    

不过,如果我只是执行 mvn jetty:run,它确实会启动服务器。 有没有人遇到过类似的问题,你们是怎么解决的?

这是我的配置:

    <plugin>
            <!-- http://cargo.codehaus.org/Maven2+Plugin+Reference+Guide -->
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <version>1.1.3</version>
            <executions>
                <execution>
                    <id>start-container</id>
                    <phase>pre-integration-test</phase>
                    <goals>
                        <goal>start</goal>
                    </goals>
                </execution>
                <execution>
                    <id>stop-container</id>
                    <phase>post-integration-test</phase>
                    <goals>
                        <goal>stop</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <wait>false</wait>
                <container>
                    <containerId>jetty6x</containerId>
                    <!-- The 'embedded' container does not seem to support 
                        setting JNDI values through a jetty-env.xml file, see http://jira.codehaus.org/browse/CARGO-861 
                        and http://jira.codehaus.org/browse/CARGO-862 for more information. For now, 
                        we'll use the 'installed' container which works fine, it is just slightly 
                        slower than the embedded version since it is a large distribution (25 mb) 
                        that must be downloaded. -->
                    <type>installed</type>
                    <zipUrlInstaller>
                        <url>http://dist.codehaus.org/jetty/jetty-6.1.26/jetty-6.1.26.zip</url>
                        <downloadDir>${project.build.directory}/downloads</downloadDir>
                        <extractDir>${project.build.directory}/extracts</extractDir>
                    </zipUrlInstaller>
                    <systemProperties>
                        <java.io.tmpdir>target/tmp</java.io.tmpdir>
                        <!-- These "jetty6.*" system properties are used 
                            to set values in the jetty-env.xml file. -->
                        <jetty6.context>Project-NAME</jetty6.context>
                        <jetty6.warFile>${project.build.directory}/project-war.war</jetty6.warFile>
                    </systemProperties>
                    <output>${project.build.directory}/cargo-container.log</output>
                    <log>${project.build.directory}/cargo.log</log>
                    <dependencies>
                        <dependency>
                            <location>${project.basedir}/src/test/keystores/sun/${keystoreType}</location>
                        </dependency>
                        <dependency>
                            <groupId>com.oracle</groupId>
                            <artifactId>ojdbc6</artifactId>
                        </dependency>
                    </dependencies>
                </container>
                <configuration>
                    <home>${project.build.directory}/jetty6x/container</home>
                    <!-- See http://cargo.codehaus.org/Configuration+properties 
                        for possible properties. -->
                    <properties>
                        <cargo.servlet.port>9090</cargo.servlet.port>
                        <cargo.logging>low</cargo.logging>
                        <!-- Enable to debug the server, see http://cargo.codehaus.org/Debugging 
                            for more information. -->
                       <!--  <cargo.jvmargs> -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8888 
                            -Xnoagent -Djava.compiler=NONE </cargo.jvmargs> -->
                    </properties>
                    <configfiles>
                        <configfile>
                            <file>${project.basedir}/src/test/keystores/sun/${keystoreType}/jetty-env.xml</file>
                            <todir>contexts</todir>
                            <tofile>project-Name.xml</tofile>
                        </configfile>
                    </configfiles>
                    <deployables>
                        <deployable>
                            <groupId><project-NAME></groupId>
                            <artifactId>project-war</artifactId>
                            <type>war</type>
                            <properties>
                                <context>project-Name</context>
                            </properties>
                        </deployable>
                    </deployables>
                </configuration>
            </configuration>
        </plugin>
  1. 我知道 codehaus 正在下降,最终将不得不更新。对于什么是部署 war 并作为客户端运行集成测试的轻量级服务器有什么建议吗?

最佳答案

根本原因:

Codehaus.org是一个死网站。 2015年5月17日100%下线。

The time has come to end the era of Codehaus.

All Codehaus services will be terminated progressively until May 17th 2015

With increasing diversity in opensource hosting platforms like Github and Bitbucket - who are meeting the needs of 1000s of projects - it makes sense to end the opensource hosting services of Codehaus.

Codehaus has operated at a loss for several years now (we're not powered by venture capital), and can not compete with the army of developers and integrated product offerings that are now commonplace.

The platform was to be terminated at the end of February 2015, however SonarQube has graciously offered to sponsor Codehaus for a few months to aid in the transition.

您对 dist.codehaus.org 的 URL 访问失败。

<url>http://dist.codehaus.org/jetty/jetty-6.1.26/jetty-6.1.26.zip</url>

其他重要说明:

  • 自 1.1.3 版本以来,cargo-maven2-plugin 已经发布了 25 个版本,考虑升级。
  • Cargo 也已离开 codehaus,请在 codehaus-cargo.github.io 找到它们现在。
  • 不要使用 Jetty 6,它在 2010 年的 EOL(生命周期结束)。
  • 曾经托管在 dist.codehaus.org 上的 Jetty 5 和 Jetty 6 二进制文件将不会有替代下载位置.
  • 不要使用 Jetty 7 or Jetty 8 either, those are EOL as of 2014 .
  • Jetty 9 是目前(2015 年 5 月)唯一稳定且受支持的 Jetty 系列。

关于java - 由于 "Negative seek offset",Cargo Maven 插件无法下载和解压 Jetty zip,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30241602/

相关文章:

java - Netbeans Maven :Java Application when run several times creates multiple instances (once for each time run), 导致端口冲突

java - keycloak 403禁止访问错误资源,同时评估api显示允许的错误

java - Android 数据库到数组

java - Apache Sling/felix 中的 OSGi slf4j 日志记录

java - 如何使用 Maven 构建存储(新构建时间戳文件夹和最新文件夹)?

java - org.apache.tomcat.SimpleInstanceManager 无法转换为 org.apache.tomcat.InstanceManager

java - Java中字符串常量池的默认大小是多少?

java - Json 和 Array 序列化 - Java Spring Boot

java.lang.NoClassDefFoundError : io/jsonwebtoken/Jwts - maven spring-boot

maven - Grails:如何使用 Maven 存储库而不是 ivy-cache