代码之家  ›  专栏  ›  技术社区  ›  Wolkenarchitekt

Maven Glassfish插件:将应用程序部署为分解的目录/文件夹

  •  4
  • Wolkenarchitekt  · 技术社区  · 14 年前

    我需要我的JavaEE应用程序作为目录部署在Glassfish上,而不是打包的WAR文件。 是否可以使用Maven Glassfish插件将目录部署到Glassfish?

    通过管理控制台,这是可能的。但我也希望能在命令行上完成。

    2 回复  |  直到 14 年前
        1
  •  5
  •   Pascal Thivent    14 年前

    以下配置适用于我(请注意 artifact

    <plugin>  
      <groupId>org.glassfish.maven.plugin</groupId>
      <artifactId>maven-glassfish-plugin</artifactId>
      <version>2.2-SNAPSHOT</version> 
      <configuration>                           
        <glassfishDirectory>${glassfish.home}</glassfishDirectory>
        <user>${domain.username}</user>                   
        <passwordFile>${glassfish.home}/domains/${project.artifactId}/master-password</passwordFile>                                                
        <autoCreate>true</autoCreate>
        <debug>true</debug>                                                   
        <echo>true</echo>
        <skip>${test.int.skip}</skip>
        <domain>
          <name>${project.artifactId}</name>
          <httpPort>8080</httpPort>
          <adminPort>4848</adminPort>
        </domain>           
        <components>
          <component>                 
            <name>${project.artifactId}</name>
            <artifact>${project.build.directory}/${project.build.finalName}</artifact>
          </component>
        </components>                                         
      </configuration>
    </plugin> 
    

    结果 asadmin 命令是:

    asadmin --host localhost --port 4848 --user admin --passwordfile /home/pascal/opt
    /glassfishv3/glassfish/domains/maven-glassfish-testcase/master-password --interac
    tive=false --echo=true --terse=true deploy --name maven-glassfish-testcase --forc
    e=false --precompilejsp=false --verify=false --enabled=true --generatermistubs=fa
    lse --availabilityenabled=false --keepreposdir=false --keepfailedstubs=false --lo
    gReportedErrors=true --upload=false --help=false /home/pascal/Projects/stackoverf
    low/maven-glassfish-testcase/target/maven-glassfish-testcase
    
        2
  •  1
  •   Jörn Horstmann    14 年前

    我没有让它与maven插件一起工作,但是可以使用glassfish/bin目录中的asadmin命令从命令行部署到glassfish:

    asadmin deploy—contextroot context\u根路径\u到\u ear\u或\u目录

    推荐文章