2

我正在使用 Maven Embedded Glassfish 插件,它运行良好,但不幸的是它在我的主项目目录中创建了一个临时目录。我希望它使用目标,这样每次我清理项目时,嵌入的目录也会被擦除。

有这样的设置吗?

沃尔特

4

2 回答 2

3

更新:根据 OP,所需的参数实际上是instanceRoot,而不是installRoot

我认为您可以 为此使用参数。将其设置为目录:installRoot instanceRoottarget

<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>
于 2010-04-25T18:16:36.673 回答
0

实际上,这样做的正确方法是使用令人愤怒且部分未记录 glassfish.embedded.tmpdir System的属性,并消除对BootstrapProperties#setInstallRoot(String)orBootstrapProperties#setInstanceRoot(String)方法的所有使用。

于 2012-08-14T21:08:03.297 回答