Deployment 填充META-INF/context.xml
我使用maven作为构建和依赖关系管理工具。我通过maven build成功地复制了META-INF文件夹中的context.xml 我想在这里动态填充context.xml文件标记中的docBase和path属性 如果有什么办法,请告诉我。最好将战争的最终名称放在docBase属性中 我不确定这是否可行。在这方面的任何帮助都将不胜感激 这是我的POM文件:Deployment 填充META-INF/context.xml,deployment,build,webserver,tomcat7,maven-3,Deployment,Build,Webserver,Tomcat7,Maven 3,我使用maven作为构建和依赖关系管理工具。我通过maven build成功地复制了META-INF文件夹中的context.xml 我想在这里动态填充context.xml文件标记中的docBase和path属性 如果有什么办法,请告诉我。最好将战争的最终名称放在docBase属性中 我不确定这是否可行。在这方面的任何帮助都将不胜感激 这是我的POM文件: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-
instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>myproj</groupId>
<artifactId>myproj</artifactId>
<version>1.0</version>
<packaging>war</packaging>
<dependencies>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>default-profile</id>
<activation>
<activeByDefault>true</activeByDefault>
<file>
<exists>${java.home}/../lib/tools.jar</exists>
</file>
</activation>
<properties>
<toolsjar>${java.home}/../lib/tools.jar</toolsjar>
</properties>
</profile>
<profile>
<id>mac-profile</id>
<activation>
<activeByDefault>false</activeByDefault>
<file>
<exists>${java.home}/../Classes/classes.jar</exists>
</file>
</activation>
<properties>
<toolsjar>${java.home}/../Classes/classes.jar</toolsjar>
</properties>
</profile>
</profiles>
<build>
<sourceDirectory>src</sourceDirectory>
<defaultGoal>clean</defaultGoal>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<doCheck>true</doCheck>
<doUpdate>true</doUpdate>
<format>{0,number} ({1,date,MMM dd, yyyy HH:mm 'PDT'})</format>
<items>
<item>buildNumber0</item>
<item>timestamp</item>
</items>
<shortRevisionLength>5</shortRevisionLength>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
</archive>
<webResources>
<resource>
<!-- this is relative to the pom.xml directory -->
<directory>${project.basedir}/src/main/resources
</directory>
</resource>
</webResources>
<warName>mywar</warName>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<finalName>${project.artifactId}-${project.version}</finalName>
</build>
</project>
谢谢首先要显示pom.xml文件吗?