Difference between revisions of "Java"

From Wasya Wiki
Jump to: navigation, search
(Deploy an artifact from Nexus to Tomcat)
Line 30: Line 30:
  
 
=== Deploy an artifact from Nexus to Tomcat ===
 
=== Deploy an artifact from Nexus to Tomcat ===
 +
sudo \
 +
curl "http://localhost:8081/repository/new-repository/org/springframework/samples/spring-petclinic/1.0.0-SNAPSHOT/spring-petclinic-1.0.0-20151027.063922-1.war" -o /var/lib/tomcat7/webapps/petclinic.war \
 +
&& service tomcat7 restart

Revision as of 00:59, 29 October 2015

  • How do you run a maven build from jenkins?

Install Java

Assume Ubuntu everywhere.

Install nexus-public from github.

From: https://www.digitalocean.com/community/tutorials/como-instalar-o-java-no-ubuntu-com-apt-get-pt

From: https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu

Install the spring-petclinic from github.

Build with Maven

mvn clean install
mvn test
sudo apt-get install tomcat7 tomcat7-docs tomcat7-admin
mvn tomcat7:run
mvn clean deploy # deploys from nexus to tomcat?
                 # http://www.baeldung.com/maven-deploy-nexus

Build and Deploy (via Maven) to Nexus with a git push

Deploy an artifact from Nexus to Tomcat

sudo \
curl "http://localhost:8081/repository/new-repository/org/springframework/samples/spring-petclinic/1.0.0-SNAPSHOT/spring-petclinic-1.0.0-20151027.063922-1.war" -o /var/lib/tomcat7/webapps/petclinic.war \
&& service tomcat7 restart