我使用的是Maven嵌入式玻璃鱼插件,它运行良好,但不幸的是,它在我的主要项目目录中创建了一个临时目录。我希望它使用目标,以便每次清洁项目时,嵌入式目录也会被擦除。

有设置吗?

沃尔特

有帮助吗?

解决方案

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

我认为您可以使用 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>

其他提示

实际上,正确的方法是使用 令人振奋和部分无证 glassfish.embedded.tmpdir System 财产,并消除所有使用 BootstrapProperties#setInstallRoot(String) 或者 BootstrapProperties#setInstanceRoot(String) 方法。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top