views:

173

answers:

1

version is glassfish v3 I want to trying maven-glassfish-plugin but I don't know how to create a new domain . Plz step by step say me,thx. And I want to looking pom.xml,thx

A: 

You can use the create-domain command. Either pass parameters on the command line or follow the interactive steps:

$ asadmin create-domain

But the Maven GlassFish Plugin (once properly configured) can also create a domain with the following goal:

glassfish:create-domain Create a new Glassfish domain. (Creating an existing domain will cause it to be deleted and recreated.)

Here is a configuration sample (inspired by the Fairly Complete Configuration Example):

<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>
    <adminPassword>${domain.password}</adminPassword>
    <!-- <passwordFile>path/to/asadmin/passfile</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}.war</artifact>
      </component>
    </components>
  </configuration>
</plugin>
Pascal Thivent
thx, I know what's wrong
EdwardLau