views:

219

answers:

1

Hi all,

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

A: 

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>
Pascal Thivent
Thanks, but that doesn't change the gfembed temp directory. I am still looking to change that to target.Walter
instanceRoot was the setting I needed.
@Walter Wasn't 100% sure about the parameter (I guess I misunderstood the bottom note of [Installation Root Directory](http://docs.sun.com/app/docs/doc/821-1208/gikqf?a=view)). Thanks for the feedback, I've updated my answer accordingly.
Pascal Thivent