0

我正在尝试使用 Jenkins 管道和 Maven 插件在 Eclipse 之外构建 ODM 项目。我正在关注链接:https ://www.ibm.com/support/knowledgecenter/en/SSQP76_8.9.0/com.ibm.odm.dserver.rules.designer.run/build_topics/con_buildcmd_intro.html 虽然这个链接运作良好在我的本地(Windows)中没有 Jenkins 管道,但是当我尝试在 Jenkins(Linux 机器)中运行相同的设置时,我收到以下错误:

[WARNING] The POM for com.ibm.rules.buildcommand:rules-compiler-maven-plugin:jar:8.10.0.0 is missing, no dependency information available
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ helloWorld:hello-xom:[unknown-version], /var/lib/jenkins/workspace/odm-devops-build/Hello XOM/pom.xml, line 19, column 21
[ERROR] Unresolveable build extension: Plugin com.ibm.rules.buildcommand:rules-compiler-maven-plugin:8.10.0.0 or one of its dependencies could not be resolved: Failure to find com.ibm.rules.buildcommand:rules-compiler-maven-plugin:jar:8.10.0.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced @ 
[ERROR] Unknown packaging: decisionservice @ helloWorld:hello-main:[unknown-version], /var/lib/jenkins/workspace/odm-devops-build/Hello Main Service/pom.xml, line 14, column 16

上述错误中引用的pom文件如下:

<?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 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>helloWorld</groupId>
        <artifactId>parent</artifactId>
        <version>1.0.0</version>
        <relativePath>..</relativePath>
    </parent>

    <artifactId>hello-main</artifactId>
    <packaging>decisionservice</packaging>

    <build>
        <plugins>
            <plugin>
                <groupId>com.ibm.rules.buildcommand</groupId>
                <artifactId>rules-compiler-maven-plugin</artifactId>
                <configuration>

                    <deployments>
                        <deployment>
                            <name>simple dep</name>
                        </deployment>
                    </deployments>

                    <resolvers>
                        <resolver>
              <!-- The values of the kind and url of the project correspond to the 'kind' and 'url' attribute values of an 'entries' element in the .ruleproject file. -->
                            <kind>JAVA_PROJECT</kind>
                            <url>platform:/Hello XOM</url>
              <!-- The artifactKey references the groupId and artifactId of a Maven dependency. -->
                            <artifactKey>${project.groupId}:hello-xom</artifactKey>
                        </resolver>
                    </resolvers>

                </configuration>
            </plugin>
        </plugins>

    </build>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>hello-xom</artifactId>
            <type>jar</type>
            <version>${project.version}</version>
        </dependency>
    </dependencies>

</project>

请让我知道是否有人遇到过类似的问题或对上述问题有可能的解决方案。

提前致谢。

4

2 回答 2

0

您在 Maven 存储库中安装 Build Command Maven 插件及其相关的 Operational Decision Manager 工件。

部署构建命令插件

您只需在包含构建代理的每台机器上部署一次插件。

要将构建命令 Maven 插件部署到远程 Maven 存储库,您必须首先在您的环境中配置 Maven。

然后,在 中<InstallDir>/buildcommand/rules-compiler,打开命令提示符。使用以下命令:

mvn deploy:deploy-file -Dfile=rules-compiler.jar -DpomFile=rules-compiler-maven-plugin.pom

如果您没有远程存储库,则可以在本地测试插件。您运行以下命令:

mvn install:install-file -Dfile=rules-compiler.jar -DpomFile=rules-compiler-maven-plugin.pom

此命令在本地 Maven 存储库中添加以下插件:

com/ibm/rules/buildcommand/rules-compiler

 部署注释存档

如果要构建 COBOL 项目或使用 XOM 注释的项目,还必须先将注释存档部署到您的环境,然后才能构建项目。

<InstallDir>/buildcommand/rules-compiler中,打开命令提示符。使用以下命令:

mvn deploy:deploy-file -Dfile=rules-compiler.jar -DpomFile=xom-annotations.pom

如果您没有远程存储库,则可以在本地测试插件。您运行以下命令:

mvn install:install-file -Dfile=rules-compiler.jar -DpomFile=xom-annotations.pom

此命令在本地 Maven 存储库中添加以下插件:

com/ibm/rules/buildcommand/xom-annotation

资源

于 2020-05-18T09:59:39.327 回答
0

可能的解决方案:“在您的 Maven 存储库中安装 Build Command Maven 插件及其相关的 Operational Decision Manager 工件”......“在每台包含构建代理的机器上”

要将构建命令 Maven 插件部署到远程Maven 存储库,您必须在您的环境中配置 Maven。然后使用以下命令: mvn deploy:deploy-file -Dfile=rules-compiler-maven-plugin.jar -DpomFile=rules-compiler-maven-plugin.pom

这需要访问 Jenkins / Maven 服务器,并且在许多公司将由 DevOps 完成。

于 2019-03-29T13:07:30.677 回答