Pom.xml

Aus Salber.net

Wechseln zu: Navigation, Suche

pom.xml ist der Name der Projektbeschreibungs-Datei in einem Maven-Projekt. In ihr werden alle wichtigen Aspekte des Projektes beschrieben.

Eine genaue Beschreibung der POM findet man auf der Webseite des Maven-Projekts.

Vorlage

<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/maven-v4_0_0.xsd">
 
<!-- ========================================================
 
                     Vorlage für pom.xml
   http://www.salber.net/docs/maven pom/vorlage/2/pom.xml
                          Version  2
                          2009-08-15
 
                     Änderungen seit Version 1
      neue Build-Plugins:
       * mvn-changes-plugin
      neue Reporting-Plugins:
       * maven-pmd-plugin
       * maven-jxr-plugin
       * taglist-maven-plugin
       * maven-changes-plugin
 
                      Aktuellste Version:
http://www.salber.net/docs/maven pom/vorlage/aktuell/pom.xml
 
========================================================= -->
 
	<modelVersion>4.0.0</modelVersion>
	<groupId>net.salber</groupId>
	<artifactId>myproject1</artifactId>
	<name>Mein Projekt 1</name>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>pom oder jar</packaging>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<encoding>UTF-8</encoding>
					<source>1.6</source>
					<target>1.6</target>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-site-plugin</artifactId>
				<configuration>
					<inputEncoding>UTF-8</inputEncoding>
					<outputEncoding>UTF-8</outputEncoding>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>test-jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
 
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>2.1</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<phase>verify</phase>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
 
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-changes-plugin</artifactId>
				<version>2.1</version>
				<executions>
					<execution>
						<id>validate-changes</id>
						<phase>pre-site</phase>
						<goals>
							<goal>changes-validate</goal>
						</goals>
						<configuration>
							<failOnError>true</failOnError>
						</configuration>
					</execution>
				</executions>
			</plugin>
 
		</plugins>
	</build>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>
	<reporting>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-checkstyle-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-surefire-report-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>cobertura-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-pmd-plugin</artifactId>
				<configuration>
					<sourceEncoding>utf-8</sourceEncoding>
					<targetJdk>1.6</targetJdk>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jxr-plugin</artifactId>
				<configuration>
					<inputEncoding>UTF-8</inputEncoding>
					<outputEncoding>UTF-8</outputEncoding>
				</configuration>
			</plugin>
			<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>taglist-maven-plugin</artifactId>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-changes-plugin</artifactId>
				<reportSets>
					<reportSet>
						<reports>
							<report>changes-report</report>
						</reports>
					</reportSet>
				</reportSets>
			</plugin>
		</plugins>
	</reporting>
	<dependencies>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>4.6</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
</project>
Persönliche Werkzeuge