jenkins 如何在Jenkinfile管道中使用javadoc

inn6fuwd  于 2023-01-08  发布在  Jenkins
关注(0)|答案(1)|浏览(132)

我想用这个:脚本化管道中的Publish JavaDoc on Jenkins with maven

vs91vp4v

vs91vp4v1#

例如,要发布JavaDoc:您可以尝试以下操作:

// Define the pipeline
pipeline {
    agent any
    
    // Stage to compile the project and generate the JavaDoc
    stages {
        stage('Compile & generate JavaDoc') {
            steps {
                // Compile the project
                sh 'mvn compile'
                
                // Generate the JavaDoc
                sh 'mvn javadoc:javadoc'
            }
        }
    }
    
    // Stage to publish the JavaDoc
    stages {
        stage('Publish JavaDoc') {
            steps {
                // Publish the JavaDoc
                sh 'mvn javadoc:jar'
            }
        }
    }
}

相关问题