Maven Embedded Glassfish Plugin - how to set temp 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 a target so that every time I clear the project, the embedded directory is also erased.

Is there a setting for this?

Walter

+2


a source to share


2 answers


Update: . According to the OP, the parameter you instanceRoot

want is actually , not installRoot

.

I think you can use a parameter . Install it in the directory : installRoot

instanceRoot

target



<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>

      

+3


a source


Actually, the correct way to do this is to use an unreasonably and partially undocumented glassfish.embedded.tmpdir

System

property and exclude all use of the BootstrapProperties#setInstallRoot(String)

or methods BootstrapProperties#setInstanceRoot(String)

.



0


a source







All Articles