我需要我的JavaEE应用被部署在Glassfish作为一个目录,而不是一个打包的WAR文件。 是否有可能部署一个目录到GlassFish使用Maven插件Glassfish的?

使用管理控制台,这是可能的。但我希望也能做到这一点的命令行。

有帮助吗?

解决方案

下面的配置适用于我(注意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

其他提示

我没有得到它与Maven插件工作,但它可以部署使用asadmin命令从GlassFish / bin目录中的命令行到Glassfish的:

  

的asadmin部署--contextroot context_root path_to_ear_or_directory

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top