Add highlighted tomcat plugin in pom.xml of maven project.
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
<configuration>
<executable>java</executable>
<arguments>
<argument>-jar</argument>
<argument>${oc4j.j2eeHome}${file.separator}admin_client.jar</argument>
<argument>${oc4j.connectionUri}</argument>
<argument>${oc4j.username}</argument>
<argument>${oc4j.password}</argument>
<argument>-deploy</argument>
<argument>-file</argument>
<argument>${project.build.directory}${file.separator}${project.artifactId}-${project.version}.${project.packaging}</argument>
<argument>-deploymentName</argument>
<argument>${project.artifactId}</argument>
<argument>-bindAllWebApps</argument>
<argument>default-web-site</argument>
<argument>-contextRoot</argument>
<argument>${project.artifactId}</argument>
</arguments>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.1</version>
<configuration>
<update>true</update>
<server>tomcatServer</server>
<username>${tomcat.username}</username>
<password>${tomcat.password}</password>
<url>${tomcat.url}</url>
<path>${tomcat.contextPath}</path>
</configuration>
</plugin>
<!-- java compiler plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
TOMCAT CONFIGURATION FOR AUTHENTICATION
A) Update server.xml and tomcat-users.xml in <tomcat home>/conf/server.xml
Add the realm inside
<Realm className="org.apache.catalina.realm.LockOutRealm">.
<Realm className="org.apache.catalina.realm.JAASRealm" appName="Tomcat"
userClassNames="javax.security.auth.kerberos.KerberosPrincipal" roleClassNames="javax.security.auth.kerberos.KerberosPrincipal" useContextClassLoader="true" debug="99"/>
B) In <tomcat home>/tomcat-users.xml
Add the role and user details under <tomcat-users>
<role rolename="users"/>
<user username="mayajose" password="password" roles="users"/>
C) Create a new file "jaas.config" in in <tomcat home>/conf folder with the below contents.
Tomcat {
com.sun.security.auth.module.Krb5LoginModule required;
};