我们正在使用 maven 依赖项在我们的 web 应用程序中添加嵌入式 tomcat。它工作正常,但我需要将systemProperties添加到嵌入式tomcat,以便我们的webapp可以使用这个systemProperties。
<build>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<executions>
<execution>
<id>tomcat-run</id>
<goals>
<goal>exec-war-only</goal>
</goals>
<phase>package</phase>
<configuration>
<path>/html5</path>
<enableNaming>true</enableNaming>
<finalName>html5.jar</finalName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
我试图添加这样的系统属性,但没有奏效。我加了
<build>
<plugins>
<plugin>
<configuration>
<systemProperties>
<dashboard.oracle.host>1.1.1.1</dashboard.oracle.host>
<dashboard.oracle.port>1521</dashboard.oracle.port>
<dashboard.oracle.sid>orcl</dashboard.oracle.sid>
<dashboard.oracle.url>
jdbc:oracle:thin:@${dashboard.oracle.host}:${dashboard.oracle.port}:${dashboard.oracle.sid}
</dashboard.oracle.url>
<dashboard.oracle.username>username</dashboard.oracle.username>
<dashboard.oracle.password>password</dashboard.oracle.password>
</systemProperties>
</configuration>
...
</plugin>
</plugins>
</build>