0

獲得一個例外,而試圖我的基於Maven的應用程序部署到Glassfish的3.1.2.2Glassfish的Maven的部署插件 - 部署失敗

我使用部署org.glassfish.maven.plugin

這裏是我的源文件:

的pom.xml

<plugin> 
    <groupId>org.glassfish.maven.plugin</groupId> 
    <artifactId>maven-glassfish-plugin</artifactId> 
    <version>${glassfish.maven.plugin.version}</version> 
    <configuration> 
     <glassfishDirectory>${local.glassfish.home}</glassfishDirectory> 
     <echo>true</echo> 
     <debug>true</debug> 
     <autoCreate>true</autoCreate> 
     <glassfishDirectory>${local.glassfish.home}</glassfishDirectory> 
     <user>${local.glassfish.user}</user> 
     <passwordFile>${local.glassfish.passfile}</passwordFile> 
     <domain> 
      <name>${local.glassfish.domain}</name> 
      <httpPort>${local.glassfish.httpPort}</httpPort> 
      <adminPort>${local.glassfish.adminPort}</adminPort> 
     </domain> 
     <components> 
      <component> 
       <name>${project.artifactId}</name> 
       <artifact>${project.build.directory}/${project.build.finalName}.war</artifact> 
      </component> 
     </components> 
    </configuration> 
</plugin> 

的settings.xml

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" 
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 
         http://maven.apache.org/xsd/settings-1.0.0.xsd"> 
    <localRepository/> 
    <interactiveMode/> 
    <usePluginRegistry/> 
    <offline/> 
    <pluginGroups/> 
    <servers/> 
    <mirrors/> 
    <proxies/> 
    <profiles> 
     <profile> 
      <id>glassfish-context</id> 
      <properties> 
       <local.glassfish.home>/home/talha/glassfish-3.1.2.2</local.glassfish.home> 
       <local.glassfish.user>admin</local.glassfish.user> 
       <local.glassfish.domain>dms</local.glassfish.domain> 
       <local.glassfish.httpPort>8080</local.glassfish.httpPort> 
       <local.glassfish.adminPort>4848</local.glassfish.adminPort> 
       <local.glassfish.passfile> 
        ${local.glassfish.home}/glassfish/domains/${local.glassfish.domain}/master-password 
       </local.glassfish.passfile> 
      </properties> 
     </profile> 
    </profiles> 

    <activeProfiles> 
     <activeProfile>glassfish-context</activeProfile> 
    </activeProfiles> 
</settings> 

完整堆棧跟蹤

[ERROR] Failed to execute goal org.glassfish.maven.plugin:maven-glassfish-plugin:2.1:deploy (default-cli) on project dms: Deployment of /home/talha/IdeaProjects/DMS/target/DMS.war failed. -> [Help 1] 
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.glassfish.maven.plugin:maven-glassfish-plugin:2.1:deploy (default-cli) on project dms: Deployment of /home/talha/IdeaProjects/DMS/target/DMS.war failed. 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213) 
    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:84) 
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) 
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) 
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) 
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) 
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) 
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) 
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) 
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:141) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:601) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) 
Caused by: org.apache.maven.plugin.MojoFailureException: Deployment of /home/talha/IdeaProjects/DMS/target/DMS.war failed. 
    at org.glassfish.maven.plugin.command.AsadminCommand.execute(AsadminCommand.java:121) 
    at org.glassfish.maven.plugin.DeployGlassfishMojo.doExecute(DeployGlassfishMojo.java:66) 
    at au.net.ocean.maven.plugin.OceanMojo.execute(OceanMojo.java:67) 
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) 
    ... 19 more 
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[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/MojoFailureException 

回答

1

您的配置幾乎是完全相同的地雷有兩種例外。

  1. 我指定的密碼文件在我的用戶家裏的.asadminpass
  2. 文件名我已經定義了一個<executions>元素如果去掉,打破構建。
<executions> 
    <execution> 
    <phase>none</phase> 
    <goals> 
     <goal>deploy</goal> 
    </goals> 
    <configuration> 
     <debug>true</debug> 
     <terse>false</terse> 
     <autoCreate>false</autoCreate> 
     <domain> 
     <name>${local.glassfish.domain}</name> 
     <httpPort>${local.glassfish.httpPort}</httpPort> 
     <adminPort>${local.glassfish.adminPort}</adminPort> 
     </domain> 
    </configuration> 
    </execution> 
</executions> 

如果沒有這些幫助,請嘗試包括問題Glassfish的日誌文件。這應該表明失敗。

+4

接受?有什麼問題? – Snekse