2012-12-31

Standard Maven pom.xml for standalone application

<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>org.jboss.qa.test</groupId>
    <artifactId>MyNewApp</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>####  MyNewApp  #####</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <mainClass>########   CHANGE THIS   ######</mainClass>
    </properties>

    <scm>
        <developerConnection> ###### scm:svn:https://svn.devel.redhat.com/repos/jboss-qa/.../trunk</developerConnection>
    </scm>

    <build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <filtering>false</filtering>
                <excludes><exclude>*.java</exclude></excludes>
            </resource>
        </resources>

        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <version>2.2.1</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration><source>1.6</source><target>1.6</target></configuration>
            </plugin>

            <!-- Assembly plugin - one big .jar -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions><execution><phase>package</phase> <goals><goal>single</goal> </goals> </execution></executions>
                <configuration>
                    <appendAssemblyId>false</appendAssemblyId>
                    <descriptorId>jar-with-dependencies</descriptorId>
                    <archive>
                        <manifest>
                            <mainClass>${mainClass}</mainClass>
                            <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
                            <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>

            <!-- Maven Release plugin -->
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-release-plugin</artifactId>
                    <configuration>
                        <tagBase> ####### https://svn.devel.redhat.com/repos/jboss-qa/.../tags</tagBase>
                    </configuration>
                </plugin>
            </plugins>

        </plugins>
    </build>

    <dependencies>

        <!-- Commons -->
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.6</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.0.1</version>
        </dependency>

        <!-- Logging -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.16</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>

    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>javax.mail</groupId>
                <artifactId>mail</artifactId>
                <version>1.4.4</version>
            </dependency>

            <!-- Slf4j -->
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>1.5.11</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>1.5.11</version>
            </dependency>

        </dependencies>
    </dependencyManagement>


    <pluginRepositories>
        <pluginRepository>
            <id>codehaus</id>
            <name>Codehaus Release Repo</name>
            <url>http://repository.codehaus.org</url>
        </pluginRepository>
        <pluginRepository>
            <id>codehaus-snapshot</id>
            <name>Codehaus Snapshot Repo</name>
            <url>http://snapshots.repository.codehaus.org</url>
        </pluginRepository>
    </pluginRepositories>

   <distributionManagement>
     <repository>
       <id>jboss-qa-brno-releases</id>
       <url>http://nexus.qa.jboss.com:1212/nexus/content/repositories/releases</url>
     </repository>
     <snapshotRepository>
       <id>jboss-qa-brno-snapshots</id>
       <url>http://nexus.qa.jboss.com:1212/nexus/content/repositories/snapshots</url>
     </snapshotRepository>
   </distributionManagement>



</project>

0