0

私はoracleからjavaee7 sdkを使用しています。私は問題に直面している。 mvn cargo:runと入力すると、長時間にわたってResolved container artifact org.codehaus.cargo:cargo-core-container-glassfish:jar:1.4.0 for container glassfish4xに停止しました。最後に、エラーが発生しました:Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run。ここでゴールを実行できませんでした。org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run

は、私の詳細手順です:

  1. 私はjava_ee_sdk-7u2.zipダウンロードしてください。
  2. 解凍します。
  3. glassfish4フォルダをC:\ glassfish4に移動します。
  4. 私はcmdをコンソールに入力し、cd C:\glassfish4を入力します。
  5. 私はmvn cleanを押します。
  6. 私はmvn verifyを押します。
  7. 私は私が最後mvn cargo:run

を押しmvn package

  • を押すと、コンソールは私にFailed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.0:runを教え、ここでは詳細エラーは、私はそれが私の問題を記述することは困難ですが知ら

    [DEBUG] [en2.ContainerRunMojo] Resolved artifact and dependencies: [file:/C:/zjf/soft/apache-maven-3.3.9/repo/org/codehaus/cargo/cargo-core-container-glassfish/1.4.0/cargo-core-container-glassfish-1.4.0.jar] 
    [INFO] [en2.ContainerRunMojo] Resolved container artifact org.codehaus.cargo:cargo-core-container-glassfish:jar:1.4.0 for container glassfish4x 
    [INFO] ------------------------------------------------------------------------ 
    [INFO] Reactor Summary: 
    [INFO] 
    [INFO] Java EE 7 Samples Main Parent Project .............. FAILURE [14:17 min] 
    [INFO] Java EE 7 JSF Samples .............................. SKIPPED 
    [INFO] Annotated Enter Flow Sample ........................ SKIPPED 
    [INFO] Composite Component Sample ......................... SKIPPED 
    [INFO] Resource Library Contracts JSF Sample .............. SKIPPED 
    [INFO] Custom Converter Sample ............................ SKIPPED 
    [INFO] Custom Namespace Composite Component Sample ........ SKIPPED 
    [INFO] Custom Validator Sample ............................ SKIPPED 
    [INFO] DateTimeConverter Sample ........................... SKIPPED 
    [INFO] Enter and Exit Flow Sample ......................... SKIPPED 
    [INFO] JSF Stock Sample ................................... SKIPPED 
    [INFO] Faces Flow JSF Sample .............................. SKIPPED 
    [INFO] Filesystem Resource Library Contract ............... SKIPPED 
    [INFO] File Upload JSF Sample ............................. SKIPPED 
    [INFO] HTML5 JSF Sample ................................... SKIPPED 
    [INFO] Index Flow Sample .................................. SKIPPED 
    [INFO] Nested Composite Component Sample .................. SKIPPED 
    [INFO] Override Renderer Sample ........................... SKIPPED 
    [INFO] Packaged Composite Component Sample ................ SKIPPED 
    [INFO] Packaged Custom Converter Sample ................... SKIPPED 
    [INFO] HTML5 Passthrough Sample ........................... SKIPPED 
    [INFO] Scrumtoys POM ...................................... SKIPPED 
    [INFO] Scrumtoys Entities ................................. SKIPPED 
    [INFO] Scrumtoys Flows POM ................................ SKIPPED 
    [INFO] Scrumtoys ManageStoryAttachments ................... SKIPPED 
    [INFO] Scrumtoys Resource Library Contracts POM ........... SKIPPED 
    [INFO] Scrumtoys Red Skin ................................. SKIPPED 
    [INFO] Scrumtoys Yellow Skin .............................. SKIPPED 
    [INFO] Scrumtoys Orange Skin .............................. SKIPPED 
    [INFO] Scrumtoys JSF Sample ............................... SKIPPED 
    [INFO] Stateless View Sample .............................. SKIPPED 
    [INFO] Style and Layout Resource Library Contract Sample .. SKIPPED 
    [INFO] Use JAR-Packaged Composite Component Sample ........ SKIPPED 
    [INFO] Use JAR-Packaged Custom Converter Sample ........... SKIPPED 
    [INFO] View-based Resource Library Contract Sample ........ SKIPPED 
    [INFO] Java EE 7 REST Samples ............................. SKIPPED 
    [INFO] Message Board REST Sample Application .............. SKIPPED 
    [INFO] Asynchronous chat REST Sample Application .......... SKIPPED 
    [INFO] Java EE 7 Servlet Samples .......................... SKIPPED 
    [INFO] annotation-war ..................................... SKIPPED 
    [INFO] async-request-war .................................. SKIPPED 
    [INFO] dynamic-registration-war ........................... SKIPPED 
    [INFO] multipart-war ...................................... SKIPPED 
    [INFO] session-cookie-config-war .......................... SKIPPED 
    [INFO] jsp-resource-in-bundled-jar-war .................... SKIPPED 
    [INFO] servlet-container-initializer ...................... SKIPPED 
    [INFO] servlet-container-initializer-war .................. SKIPPED 
    [INFO] servlet-container-initializer-lib .................. SKIPPED 
    [INFO] absolute-ordering-web-fragments .................... SKIPPED 
    [INFO] fragment1 .......................................... SKIPPED 
    [INFO] fragment2 .......................................... SKIPPED 
    [INFO] fragment3 .......................................... SKIPPED 
    [INFO] absolute-ordering-web-fragments-war ................ SKIPPED 
    [INFO] non-blocking-io-read-war ........................... SKIPPED 
    [INFO] non-blocking-io-write-war .......................... SKIPPED 
    [INFO] http-upgrade-war ................................... SKIPPED 
    [INFO] Java EE 7 WebSocket Samples ........................ SKIPPED 
    [INFO] WebSocket Auction Sample Application ............... SKIPPED 
    [INFO] WebSocket Draw Sample Application .................. SKIPPED 
    [INFO] WebSocket Echo Sample Application .................. SKIPPED 
    [INFO] Java EE 7 CDI Samples .............................. SKIPPED 
    [INFO] Events CDI Sample Application ...................... SKIPPED 
    [INFO] Interceptors CDI Sample Application ................ SKIPPED 
    [INFO] Guess CDI Sample Application ....................... SKIPPED 
    [INFO] Servlet CDI Sample Application ..................... SKIPPED 
    [INFO] CDI Sample Application for TransactionScoped annotation SKIPPED 
    [INFO] CDI Sample Application for Transactional annotation SKIPPED 
    [INFO] CDI Sample Application for Bean Validation ......... SKIPPED 
    [INFO] Java EE 7 JSON-P Samples ........................... SKIPPED 
    [INFO] JSON-P JAX-RS Resources Sample Application ......... SKIPPED 
    [INFO] ------------------------------------------------------------------------ 
    [INFO] BUILD FAILURE 
    [INFO] ------------------------------------------------------------------------ 
    [INFO] Total time: 14:33 min 
    [INFO] Finished at: 2016-12-07T23:19:37+08:00 
    [INFO] Final Memory: 15M/174M 
    [INFO] ------------------------------------------------------------------------ 
    [ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run (default-cli) on project glassfish-samples-parent: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run 
    failed: Error while expanding C:\Users\zjf\AppData\Local\Temp\cargo\installs\glassfish-4.0.zip 
    [ERROR] java.io.IOException: Negative seek offset 
    [ERROR] -> [Help 1] 
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run (default-cli) on project glassfish-samples-parent: Execution default-cli of goal o 
    rg.codehaus.cargo:cargo-maven2-plugin:1.4.0:run failed: Error while expanding C:\Users\zjf\AppData\Local\Temp\cargo\installs\glassfish-4.0.zip 
    java.io.IOException: Negative seek offset 
         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) 
         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) 
         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) 
         at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) 
         at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) 
         at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) 
         at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) 
         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) 
         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) 
         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) 
         at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) 
         at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) 
         at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) 
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
         at java.lang.reflect.Method.invoke(Method.java:498) 
         at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) 
         at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) 
         at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) 
         at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) 
    Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.codehaus.cargo:cargo-maven2-plugin:1.4.0:run failed: Error while expanding C:\Users\zjf\AppData\Local\Temp\cargo\in 
    stalls\glassfish-4.0.zip 
    java.io.IOException: Negative seek offset 
         at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145) 
         at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) 
         ... 20 more 
    Caused by: Error while expanding C:\Users\zjf\AppData\Local\Temp\cargo\installs\glassfish-4.0.zip 
    java.io.IOException: Negative seek offset 
         at org.apache.tools.ant.taskdefs.Expand.expandFile(Expand.java:148) 
         at org.apache.tools.ant.taskdefs.Expand.execute(Expand.java:107) 
         at org.codehaus.cargo.container.installer.ZipURLInstaller.unpack(ZipURLInstaller.java:355) 
         at org.codehaus.cargo.container.installer.ZipURLInstaller.install(ZipURLInstaller.java:236) 
         at org.codehaus.cargo.maven2.configuration.Container.setupHome(Container.java:793) 
         at org.codehaus.cargo.maven2.configuration.Container.createContainer(Container.java:460) 
         at org.codehaus.cargo.maven2.AbstractCargoMojo.createNewContainer(AbstractCargoMojo.java:719) 
         at org.codehaus.cargo.maven2.ContainerRunMojo.createNewContainer(ContainerRunMojo.java:150) 
         at org.codehaus.cargo.maven2.AbstractCargoMojo.createContainer(AbstractCargoMojo.java:630) 
         at org.codehaus.cargo.maven2.ContainerStartMojo.doExecute(ContainerStartMojo.java:54) 
         at org.codehaus.cargo.maven2.ContainerRunMojo.doExecute(ContainerRunMojo.java:86) 
         at org.codehaus.cargo.maven2.AbstractCargoMojo.execute(AbstractCargoMojo.java:432) 
         at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) 
         ... 21 more 
    Caused by: java.io.IOException: Negative seek offset 
         at java.io.RandomAccessFile.seek(RandomAccessFile.java:555) 
         at org.apache.tools.zip.ZipFile.positionAtCentralDirectory(ZipFile.java:403) 
         at org.apache.tools.zip.ZipFile.populateFromCentralDirectory(ZipFile.java:271) 
         at org.apache.tools.zip.ZipFile.<init>(ZipFile.java:152) 
         at org.apache.tools.ant.taskdefs.Expand.expandFile(Expand.java:137) 
         ... 33 more 
    [ERROR] 
    [ERROR] 
    [ERROR] For more information about the errors and possible solutions, please read the following articles: 
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException 
    

    です。だから私はあなたが私がやったことと同じ手順を踏んでくれることを願っています。そして同じ問題が発生します。私は誰かがそれを解決できることを望む。

  • 答えて

    0

    私は問題を知っています。 mvn packageの代わりにmvn installを使用してください。また、mvn installを使用した後、ディレクトリをsamples/servlet/annotationに変更してからmvn cargo:runを実行してください。最後に正しい結果が実行されます。

    The Correct Result

    関連する問題