maven-2glassfishmaven-pluginglassfish-3glassfish-embedded

Maven Embedded Glassfish Plugin - how to set the temporary directory?


I am using the Maven Embedded Glassfish Plugin and it works great, but unfortunately it creates a temporary directory in my main project directory. I would like it to use target so that every time I clean the project, the embedded directory also gets wiped.

Is there a setting for that?

Walter


Solution

  • Update: According to the OP, the needed parameter is actually instanceRoot, not installRoot.

    I think that you can use the installRoot instanceRoot parameter for this. Set it to the target directory:

    <plugin>
      <groupId>org.glassfish</groupId>
      <artifactId>maven-embedded-glassfish-plugin</artifactId>
      <version>3.0</version>
      <configuration>
        <instanceRoot>${project.build.directory}</instanceRoot>
        <goalPrefix>glassfish</goalPrefix>
        <app>target/test.war</app>
        <port>8080</port>
        <contextRoot>test</contextRoot>
      </configuration>
      <executions>
        <execution>
          <phase>install</phase>
          <goals>
            <goal>run</goal>
          </goals>
        </execution>
      </executions>
    </plugin>