无法执行目标org.codehaus.mojo:exec-maven-plugin -Jenkins

时间:2018-04-02 10:23:00

标签: maven jenkins

由于以下错误,我的Jenkins构建失败。我不确定是什么造成的,请有人帮忙。

我们没有改变任何东西

09:22:00 [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (app-deploy) on project private-equity-addin: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
09:22:00 [ERROR] 
09:22:00 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
09:22:00 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
09:22:00 [ERROR] 
09:22:00 [ERROR] For more information about the errors and possible solutions, please read the following articles:
09:22:00 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
09:22:00 [ERROR] 
09:22:00 [ERROR] After correcting the problems, you can resume the build with the command
09:22:00 [ERROR]   mvn <goals> -rf :private-equity-addin

下面是jenkins作业中的脚本,我只在构建阶段下面给出。

 stage("Setup") {
            env.DBUSER = "${NODE_NAME}_${EXECUTOR_NUMBER}"
            env.DBPASS = "${NODE_NAME}_${EXECUTOR_NUMBER}"
            env.GIT_SSH = "/var/hudson/job-config/pv/git-ssh.sh"
            env.JAVA_HOME = tool name: 'java1.8.0_71', type: 'jdk'
            env.M2_HOME = tool name: 'maven 3.3.9', type: 'maven'

            currentBuild.description = "$BRANCH, $VERSION"
        }
            stage("Build") {
                sh "$M2_HOME/bin/mvn -pl warehouse/code/db --batch-mode -am clean process-classes -DskipDb=false -Ddb.username=$DBUSER -Ddb.password=$DBPASS"
                sh "$M2_HOME/bin/mvn -pl qag/build/plugins/xll-maven-plugin --batch-mode -am clean install -DskipTests=true"
                sh "$M2_HOME/bin/mvn clean source:jar deploy -T 4 --batch-mode -P s-pd-dt-jk-mvn-deploy -DskipRpm=true -DskipAppDeploy=true -DskipTests=true -DfastSqlj=true -Dxxx.properties=$WORKSPACE/xxx.properties"
            }

它失败的地方如下,把pom.xml的部分放在

<profile>
                        <id>samba</id>
                        <activation>
                                <file>
                                        <exists>/usr/bin/smbclient</exists>
                                </file>
                        </activation>
                        <build>
                                <plugins>
                                        <plugin>
                                                <groupId>org.codehaus.mojo</groupId>
                                                <artifactId>exec-maven-plugin</artifactId>
                                                <executions>
                                                        <execution>
                                                                <id>app-deploy</id>
                                                                <phase>deploy</phase>
                                                                <goals>
                                                                        <goal>exec</goal>
                                                                </goals>
                                                        </execution>
                                                </executions>
                                                <configuration>
                                                        <goal>exec</goal>
                                                        <executable>/usr/bin/smbclient</executable>
                                                        <workingDirectory>${project.build.directory}</workingDirectory>
                                                        <arguments>
                                                                <argument>${dfs.address}</argument>
                                                                <argument>${dfs.pass}</argument>
                                                                <argument>-U</argument>
                                                                <argument>${dfs.user}</argument>
                                                                <argument>-W</argument>
                                                                <argument>MARKIT</argument>
                                                                <argument>-c</argument>
                                                                <argument>prompt off; recurse on; cd ${dfs.addin.dir}/${addin.dir}; mput ${addin.name.base}*</argument>
                                                        </arguments>
                                                </configuration>
                                        </plugin>
                                </plugins>
                        </build>
                </profile>

0 个答案:

没有答案