File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ 
3+ echo  ' The following Maven command installs your Maven-built Java application' 
4+ echo  ' into the local Maven repository, which will ultimately be stored in' 
5+ echo  ' Jenkins' ' s local Maven repository (and the "maven-repository" Docker data' 
6+ echo  ' volume).' 
7+ set  -x
8+ mvn jar:jar install:install help:evaluate -Dexpression=project.name
9+ set  +x
10+ 
11+ echo  ' The following complex command extracts the value of the <name/> element' 
12+ echo  ' within <project/> of your Java/Maven project' ' s "pom.xml" file.' 
13+ set  -x
14+ NAME=` mvn help:evaluate -Dexpression=project.name |  grep " ^[^\[]" ` 
15+ set  +x
16+ 
17+ echo  ' The following complex command behaves similarly to the previous one but' 
18+ echo  ' extracts the value of the <version/> element within <project/> instead.' 
19+ set  -x
20+ VERSION=` mvn help:evaluate -Dexpression=project.version |  grep " ^[^\[]" ` 
21+ set  +x
22+ 
23+ echo  ' The following command runs and outputs the execution of your Java' 
24+ echo  ' application (which Jenkins built using Maven) to the Jenkins UI.' 
25+ set  -x
26+ java -jar target/${NAME} -${VERSION} .jar
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments