Java spring boot应用程序不是';不要从詹金斯开始

Java spring boot应用程序不是';不要从詹金斯开始,java,spring-boot,jenkins,tomcat,jenkins-groovy,Java,Spring Boot,Jenkins,Tomcat,Jenkins Groovy,我正在从git克隆这个项目,并进行mvn清洁测试包sonar:sonar和deploy 但是项目没有运行,我也尝试过自由式的工作,但都是一样的 这是SpringBootJAR应用程序 pipeline { agent any stages{ stage('Git') { steps { echo "Cloning" git branch: '*****',

我正在从git克隆这个项目,并进行mvn清洁测试包sonar:sonar和deploy 但是项目没有运行,我也尝试过自由式的工作,但都是一样的 这是SpringBootJAR应用程序

pipeline {
 agent any
 stages{ 
    
         
    
    stage('Git') { 
        steps {
            echo "Cloning" 
            git branch: '*****', url: 'https://github.com/****.git'
    
        }
    }
    
    stage('clean') {
       
       steps{
           echo "Cleaning the project"
           bat 'mvn clean'
       }
    }
    
    stage('Test') {
        
        steps {
            echo "Doing the tests"
            bat 'mvn test'
         
            }
            
        
        }
    stage('SONAR') {
        steps{
             echo "Cleaning Code";
             bat 'mvn sonar:sonar';
       }
    }
    stage('MVN PACKAGE') {
       steps{
           echo "packing the project";
           bat 'mvn package';
       }
       post{
           success {
            archiveArtifacts 'target/*.jar';
           }
       }
    }
    
     stage('NEXUS') {
       steps{
           echo "Deploying the project";
           bat 'mvn  deploy:deploy-file -DgroupId=**** -DartifactId=**** -Dversion=1.0 -DgeneratePom=true -Dpackaging=jar -DrepositoryId=deploymentRepo -Durl=http://localhost:8081/repository/maven-releases/ -Dfile=target/****-1.0.jar ';
       }
    }
     
   
  
    } ...}}
由于Tomcat没有开始运行,我的测试没有运行,它应该做6个测试

 [INFO] -------------------------------------------------------
    [INFO]  T E S T S
    [INFO] -------------------------------------------------------
    [INFO] 
    [INFO] Results:
    [INFO] 
    [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
    [INFO] 
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time:  46.816 s
    [INFO] Finished at: 2020-11-05T02:52:20+01:00
    [INFO] ------------------------------------------------------------------------
    
即使sonar也没有显示项目中的单元测试,你能帮我吗

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.2.1.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>
    <groupId>tn.esprit.spring</groupId>
    <artifactId>timesheet</artifactId>
    <version>1.0</version>
    <name>timesheet</name>
    <description>timesheet</description>

    <properties>
        <java.version>1.8</java.version>
        <maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
    </properties>

    <dependencies>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-validation</artifactId>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                    
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <scope>test</scope>
        </dependency>
dependency>

            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
            
            </dependency>
            
            <dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>4.11</version>
  <scope>test</scope>
</dependency>
        

    </dependencies>



    <build>
        <outputDirectory>src/main/webapp/WEB-INF/classes</outputDirectory>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

4.0.0
org.springframework.boot
spring启动程序父级
2.2.1.发布
斯普瑞特春天酒店
时间表
1
时间表
时间表
1.8
3.1.1
org.springframework.boot
弹簧靴开发工具
org.springframework.boot
spring引导启动器数据jpa
org.springframework.boot
SpringBootStarterWeb
org.springframework.boot
弹簧启动启动器验证
mysql
mysql连接器java
运行时
org.springframework.boot
弹簧起动试验
测试
org.junit.vintage
朱尼特老式发动机
org.junit.jupiter
JUnitJupiter api
测试
依赖性>
log4j
log4j
1.2.17
朱尼特
朱尼特
4.11
测试
src/main/webapp/WEB-INF/classes
org.springframework.boot
springbootmaven插件
mvn编译

D:\2-SPRING\jenkins\jenkins\workspace\pipeline timesheet project>mvn compile 
[INFO] Scanning for projects...
[INFO] 
[INFO] ---------------------< tn.esprit.spring:timesheet >---------------------
[INFO] Building timesheet 1.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ timesheet ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ timesheet ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 35 source files to D:\2-SPRING\jenkins\jenkins\workspace\pipeline timesheet project\src\main\webapp\WEB-INF\classes
[INFO] /D:/2-SPRING/jenkins/jenkins/workspace/pipeline timesheet project/src/main/java/tn/esprit/spring/TimesheetApplication.java: D:\2-SPRING\jenkins\jenkins\workspace\pipeline timesheet project\src\main\java\tn\esprit\spring\TimesheetApplication.java uses unchecked or unsafe operations.
[INFO] /D:/2-SPRING/jenkins/jenkins/workspace/pipeline timesheet project/src/main/java/tn/esprit/spring/TimesheetApplication.java: Recompile with -Xlint:unchecked for details.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  39.156 s
[INFO] Finished at: 2020-11-05T04:07:57+01:00
[INFO] ------------------------------------------------------------------------
D:\2-SPRING\jenkins\jenkins\workspace\pipeline时间表项目>mvn编译
[信息]正在扫描项目。。。
[信息]
[信息]-----------------------------------
[信息]建筑时间表1.0
[信息]------------------------------------[jar]---------------------------------
[信息]
[信息]---maven资源插件:3.1.0:resources(默认资源)@timesheet---
[信息]使用“UTF-8”编码复制筛选的资源。
[信息]正在复制1个资源
[信息]正在复制1个资源
[信息]
[信息]---maven编译器插件:3.8.1:编译(默认编译)@timesheet---
[信息]检测到更改-重新编译模块!
[信息]将35个源文件编译为D:\2-SPRING\jenkins\jenkins\workspace\pipeline timesheet project\src\main\webapp\WEB-INF\classes
[INFO]/D:/2-SPRING/jenkins/jenkins/workspace/pipeline timesheet project/src/main/java/tn/esprit/SPRING/TimesheetApplication.java:D:\2-SPRING\jenkins\jenkins\workspace\pipeline timesheet project\src\main\java\tn\esprit\SPRING\TimesheetApplication.java使用未经检查或不安全的操作。
[INFO]/D:/2-SPRING/jenkins/jenkins/workspace/pipeline timesheet project/src/main/java/tn/esprit/SPRING/TimesheetApplication.java:使用-Xlint重新编译:未选中以获取详细信息。
[信息]------------------------------------------------------------------------
[信息]建立成功
[信息]------------------------------------------------------------------------
[信息]总时间:39.156秒
[信息]完成时间:2020-11-05T04:07:57+01:00
[信息]------------------------------------------------------------------------
mvn声纳:声纳

D:\2-SPRING\jenkins\jenkins\workspace\pipeline timesheet project>mvn sonar:sonar 
[INFO] Scanning for projects...
[INFO] 
[INFO] ---------------------< tn.esprit.spring:timesheet >---------------------
[INFO] Building timesheet 1.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- sonar-maven-plugin:3.7.0.1746:sonar (default-cli) @ timesheet ---
[INFO] User cache: C:\windows\system32\config\systemprofile\.sonar\cache
[INFO] SonarQube version: 6.7.7
[INFO] Default locale: "fr_FR", source code encoding: "UTF-8"
[INFO] Publish mode
[INFO] Load global settings
[INFO] Load global settings (done) | time=1186ms
[INFO] Server id: BF41A1F2-AXWFQCU12uRh5xSTg2DK
[INFO] User cache: C:\windows\system32\config\systemprofile\.sonar\cache
[INFO] Load plugins index
[INFO] Load plugins index (done) | time=230ms
[INFO] Process project properties
[INFO] Load project repositories
[INFO] Load project repositories (done) | time=2067ms
[INFO] Load quality profiles
[INFO] Load quality profiles (done) | time=1483ms
[INFO] Load active rules
[INFO] Load active rules (done) | time=3900ms
[INFO] Load metrics repository
[INFO] Load metrics repository (done) | time=380ms
[INFO] Project key: tn.esprit.spring:timesheet
[INFO] -------------  Scan timesheet
[INFO] Load server rules
[INFO] Load server rules (done) | time=160ms
[INFO] Base dir: D:\2-SPRING\jenkins\jenkins\workspace\pipeline timesheet project
[INFO] Working dir: D:\2-SPRING\jenkins\jenkins\workspace\pipeline timesheet project\target\sonar
[INFO] Source paths: pom.xml, src/main/java
[INFO] Test paths: src/test/java
[INFO] Source encoding: UTF-8, default locale: fr_FR
[INFO] Index files
[INFO] 39 files indexed
[INFO] Quality profile for java: Sonar way
[INFO] Quality profile for xml: Sonar way
[INFO] Sensor JavaSquidSensor [java]
[INFO] Configured Java source version (sonar.java.source): 8
[INFO] JavaClasspath initialization
[INFO] JavaClasspath initialization (done) | time=80ms
[INFO] JavaTestClasspath initialization
[INFO] JavaTestClasspath initialization (done) | time=10ms
[INFO] Java Main Files AST scan
[INFO] 35 source files to be analyzed
[INFO] 35/35 source files have been analyzed
[WARNING] Classes not found during the analysis : [javax.annotation.meta.When]
[INFO] Java Main Files AST scan (done) | time=4596ms
[INFO] Java Test Files AST scan
[INFO] 3 source files to be analyzed
[INFO] 3/3 source files have been analyzed
[INFO] Java Test Files AST scan (done) | time=90ms
[INFO] Sensor JavaSquidSensor [java] (done) | time=6680ms
[INFO] Sensor SurefireSensor [java]
[INFO] parsing [D:\2-SPRING\jenkins\jenkins\workspace\pipeline timesheet project\target\surefire-reports]
[INFO] Sensor SurefireSensor [java] (done) | time=0ms
[INFO] Sensor JaCoCoSensor [java]
[INFO] Sensor JaCoCoSensor [java] (done) | time=0ms
[INFO] Sensor SonarJavaXmlFileSensor [java]
[INFO] 1 source files to be analyzed
[INFO] Sensor SonarJavaXmlFileSensor [java] (done) | time=3850ms
[INFO] 1/1 source files have been analyzed
[INFO] Sensor XML Sensor [xml]
[INFO] Sensor XML Sensor [xml] (done) | time=510ms
[INFO] Sensor Analyzer for "php.ini" files [php]
[INFO] Sensor Analyzer for "php.ini" files [php] (done) | time=30ms
[INFO] Sensor Zero Coverage Sensor
[INFO] Sensor Zero Coverage Sensor (done) | time=170ms
[INFO] Sensor CPD Block Indexer
[INFO] Sensor CPD Block Indexer (done) | time=130ms
[INFO] 11 files had no CPD blocks
[INFO] Calculating CPD for 24 files
[INFO] CPD calculation finished
[INFO] Analysis report generated in 679ms, dir size=187 KB
[INFO] Analysis reports compressed in 160ms, zip size=107 KB
[INFO] Analysis report uploaded in 90ms
[INFO] ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard/index/tn.esprit.spring:timesheet
[INFO] Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
[INFO] More about the report processing at http://localhost:9000/api/ce/task?id=AXWWYaz_JnFpsXr-KFku
[INFO] Task total time: 57.427 s
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:22 min
[INFO] Finished at: 2020-11-05T04:09:45+01:00
[INFO] ------------------------------------------------------------------------
D:\2-SPRING\jenkins\jenkins\workspace\pipeline时间表项目>mvn sonar:sonar
[信息]正在扫描项目。。。
[信息]
[信息]-----------------------------------
[信息]建筑时间表1.0
[信息]------------------------------------[jar]---------------------------------
[信息]
[信息]---sonar maven插件:3.7.0.1746:sonar(默认cli)@时间表---
[信息]用户缓存:C:\windows\system32\config\systemprofile\.sonar\cache
[信息]SonarQube版本:6.7.7
[信息]默认区域设置:“fr_fr”,源代码编码:“UTF-8”
[信息]发布模式
[信息]加载全局设置
[信息]加载全局设置(完成)|时间=1186ms
[信息]服务器id:BF41A1F2-AXWFQCU12uRh5xSTg2DK
[信息]用户缓存:C:\windows\system32\config\systemprofile\.sonar\cache
[信息]加载插件索引
[信息]加载插件索引(完成)|时间=230ms
[信息]流程项目属性
[信息]加载项目存储库
[信息]加载项目存储库(完成)|时间=2067ms
[信息]加载质量配置文件
[信息]加载质量配置文件(完成)|时间=1483ms
[信息]加载活动规则
[信息]加载活动规则(完成)|时间=3900ms
[信息]加载度量存储库
[信息]加载度量存储库(完成)|时间=380ms
[信息]项目密钥:tn.esprit.spring:时间表
[信息]------扫描时间表
[信息]加载服务器规则
[信息]加载服务器规则(完成)|时间=160毫秒
[信息]基本目录:D:\2-SPRING\jenkins\jenkins\workspace\pipeline时间表项目
[信息]工作目录:D:\2-SPRING\jenkins\jenkins\workspace\pipeline时间表项目\target\sonar
[INFO]源路径:pom.xml,src/main/java
[INFO]测试路径:src/Test/java
[信息]源编码:UTF-8,默认区域设置:fr\u fr
[信息]索引文件
[信息]39个文件已索引
[信息]java的质量概况:声纳方式
[信息]xml的质量配置文件:声纳方式
[INFO]传感器JavaSquid传感器[java]
[信息]配置的Java源代码版本(sonar.Java.source):8
[INFO]JavaClasspath初始化
[INFO]JavaClasspath初始化(完成)|时间=80ms
[INFO]JavaTestClasspath初始化
[INFO]JavaTestClasspath初始化(完成)|时间=10ms
[信息]Java主文件AST扫描
[信息]需要分析的35个源文件
[信息]已分析35/35个源文件
[警告]分析期间未找到类:[javax.annotation.meta.When]
[信息]Java主文件AST扫描(完成)|时间=4596ms
[信息]Java测试文件AST扫描
[信息]需要分析的3个源文件
[INFO]已分析了3/3个源文件
[信息]Java测试文件
D:\2-SPRING\jenkins\jenkins\workspace\pipeline timesheet project>mvn deploy:deploy-file -DgroupId=tn.esprit -DartifactId=timesheet -Dversion=1.0 -DgeneratePom=true -Dpackaging=jar -DrepositoryId=deploymentRepo -Durl=http://localhost:8081/repository/maven-releases/ -Dfile=target/timesheet-1.0.jar  
[INFO] Scanning for projects...
[INFO] 
[INFO] ---------------------< tn.esprit.spring:timesheet>---------------------
[INFO] Building timesheet 1.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-deploy-plugin:2.8.2:deploy-file (default-cli) @ timesheet ---
Uploading to deploymentRepo: http://localhost:8081/repository/maven-releases/tn/esprit/timesheet/1.0/timesheet-1.0.jar
   
                   
Uploaded to deploymentRepo: http://localhost:8081/repository/maven-releases/tn/esprit/timesheet/1.0/timesheet-1.0.jar (54 MB at 6.5 MB/s)
Uploading to deploymentRepo: http://localhost:8081/repository/maven-releases/tn/esprit/timesheet/1.0/timesheet-1.0.pom
Progress (1): 390 B
                   
Uploaded to deploymentRepo: http://localhost:8081/repository/maven-releases/tn/esprit/timesheet/1.0/timesheet-1.0.pom (390 B at 82 B/s)
Downloading from deploymentRepo: http://localhost:8081/repository/maven-releases/tn/esprit/timesheet/maven-metadata.xml
Uploading to deploymentRepo: http://localhost:8081/repository/maven-releases/tn/esprit/timesheet/maven-metadata.xml
Progress (1): 294 B
                   
Uploaded to deploymentRepo: http://localhost:8081/repository/maven-releases/tn/esprit/timesheet/maven-metadata.xml (294 B at 104 B/s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  19.030 s
[INFO] Finished at: 2020-11-05T04:10:36+01:00
[INFO] ------------------------------------------------------------------------
[Pipeline] }