maven 自定义变量

可以用properties这个标签来自定义变量,例如:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

	<modelVersion>4.0.0</modelVersion>
	<groupId>com.springinaction</groupId>
	<artifactId>springidol</artifactId>
	<version>3.0.0</version>
	<packaging>jar</packaging>

	<name>Spring in Action Spring Idol</name>
	<url>http://www.manning.com/walls4</url>

	<properties>
		<spring.group>org.springframework</spring.group>
		<spring.version>3.1.1.RELEASE</spring.version>
	</properties>

	<dependencies>
		<dependency>
			<groupId>${spring.group}</groupId>
			<artifactId>spring-context</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>${spring.group}</groupId>
			<artifactId>spring-aop</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>${spring.group}</groupId>
			<artifactId>spring-aspects</artifactId>
			<version>${spring.version}</version>
		</dependency>

		<dependency>
			<groupId>${spring.group}</groupId>
			<artifactId>spring-test</artifactId>
			<version>${spring.version}</version>
		</dependency>

		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.6</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
</project>


你可能感兴趣的:(maven 自定义变量)