pom.xml
file of previous application-WebApplication and rewrite the code as shown below.
[xml]
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>com.sample.webproject</groupId>
<artifactId>WebApplication</artifactId>
<packaging>war</packaging>
<version>1.0 </version>
<name>WebApplication Maven Webapp</name>
<url>http://maven.apache.org</url>
<scm>
<url>http://www.svn.com</url>
<connection>scm:svn:http://localhost:8011/svn/jrepo/trunk/Framework</connection>
<developerConnection>
scm:svn:test/test123@localhost:8011:common_core_api:1101:code
</developerConnection>
</scm>
<distributionManagement>
<repository>
<id>Sample-Web-App-Release</id>
<name>Release repository</name>
<url>
http://localhost:8082/nexus/content/repositories/Sample-Web-App-Release
</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.0-beta-9</version>
<configuration>
<useReleaseProfile>false</useReleaseProfile>
<goals>deploy</goals>
<scmCommentPrefix>[Sample-Web-App-checkin]</scmCommentPrefix>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
[/xml]
The above XML file consists of 3 main tags.
Element | Description |
---|---|
SCM | SCM configures the location of SVN where the source code is placed. |
Repository | The location of JAR/WAR files after the project build is successful. |
Plug-in | Release plugin used for deployment automation. |
mvn release:prepare
After the build is successful, enter the below command to upload the WAR file into the repository.
mvn release:perform