Difference between revisions of "Java"

From Wasya Wiki
Jump to: navigation, search
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
* [[Jenkins]]
 
* [[Jenkins]]
* [[Sonatype Nexus]]
 
* [[Tomcat]]
 
* [[Maven]]
 
* [[Sonarqube]]
 
  
* How do you run a maven build from jenkins?
 
  
=== Install Java ===
 
From: https://www.digitalocean.com/community/tutorials/como-instalar-o-java-no-ubuntu-com-apt-get-pt
 
  
=== Build with Maven ===
+
= Install Java =
 +
 
 +
  sudo apt install default-jre # (openjdk 11)
 +
 
 +
  update-alternatives --config java
 +
 
 +
= Build =
 +
== Build with Maven ==
  
 
  mvn clean install
 
  mvn clean install
Line 19: Line 19:
 
                   # http://www.baeldung.com/maven-deploy-nexus
 
                   # http://www.baeldung.com/maven-deploy-nexus
  
=== Build and Deploy (via Maven) to Nexus with a git push ===
+
== Build and Deploy (via Maven) to Nexus with a git push ==
 +
piousbox@piousbox-samsung:~/projects/java/spring-petclinic/.git/hooks$ pwd
 +
/home/piousbox/projects/java/spring-petclinic/.git/hooks
 +
piousbox@piousbox-samsung:~/projects/java/spring-petclinic/.git/hooks$ cat pre-push
 +
#!/bin/bash
 +
# echo "+++ +++ pre-push"
 +
curl http://localhost:8080/git/notifyCommit?url=https://github.com/piousbox/spring-petclinic.git
 +
piousbox@piousbox-samsung:~/projects/java/spring-petclinic/.git/hooks$
 +
 
 +
== 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
  
=== Deploy an artifact from Nexus to Tomcat ===
+
= Selenium =
 +
* https://github.com/bonigarcia/webdrivermanager

Latest revision as of 15:37, 19 February 2025


Install Java

 sudo apt install default-jre # (openjdk 11)
 update-alternatives --config java

Build

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

piousbox@piousbox-samsung:~/projects/java/spring-petclinic/.git/hooks$ pwd
/home/piousbox/projects/java/spring-petclinic/.git/hooks
piousbox@piousbox-samsung:~/projects/java/spring-petclinic/.git/hooks$ cat pre-push
#!/bin/bash
# echo "+++ +++ pre-push"
curl http://localhost:8080/git/notifyCommit?url=https://github.com/piousbox/spring-petclinic.git
piousbox@piousbox-samsung:~/projects/java/spring-petclinic/.git/hooks$

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

Selenium