1

我正在尝试使用 Jenkins 进行持续构建,并尝试使用 Jenkins 部署这些构建。

我已经配置了 Jenkins 自由样式作业来检查来自 SVN 的代码并使用pre-integration-test -P<environment>.

这项工作是成功地构建我的 SOA 组合并将其部署到 weblogic 上。但我不想部署我的每个构建。我想将我的部署限制在服务器上。

如果我配置 Jenkins 作业以建立我的 SOAmvn clean package目标。我如何触发我的其他 Jenkins 作业来部署先前生成的工件。我们的基础设施中没有任何联系/人工制品。我们将构建存储在 Jenkins 工作区中。

我已经配置了两个 Jenkins 作业,一个用于构建应用程序,mvn clean package它会使用mvn pre-integration-test. 但是在我的第二份工作中,预集成测试再次从验证阶段开始,再次产生我的 sar。是否有任何插件可以部署我的 sar 而无需重新编译/重新构建它。

请帮我解决这个问题。

这是我的POM:

http://maven.apache.org/maven-v4_0_0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/ 2001/XMLSchema 实例">

<modelVersion>4.0.0</modelVersion>

<parent>
   <groupId>com.oracle.servicebus</groupId>
    <artifactId>sbar-project-common</artifactId>
    <version>12.2.1-1-0</version>
    <relativePath></relativePath>
</parent>

<groupId>ServiceBusApplication1</groupId>
<artifactId>SBProject</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>sbar</packaging>

<description/>
 <build>
            <plugins>
                <plugin>
                    <groupId>com.oracle.servicebus-plugin</groupId>
                    <artifactId>oracle-servicebus-plugin</artifactId>
                    <version>12.2.1-1-0</version>
                    <configuration>
                    </configuration>    
                </plugin>
            </plugins>
  </build>

<profiles>  
   <profile>
        <id>Dev</id>
       <properties>
            <oracleServerUrl>http://serverDev.com:7001</oracleServerUrl>
            <oracleUsername>username</oracleUsername>
            <oraclePassword>password</oraclePassword>
            <oracleHome>path to oracle home</oracleHome>
            <customization>path to configuration file</customization>
        </properties>

   </profile>
 </profiles>

4

1 回答 1

0

您的第二个作业再次构建整个 jar 的原因是因为您正在执行一个目标pre-integration-test,其中包括之前的Maven 生命周期阶段

package - 获取已编译的代码并将其打包成可分发的格式,例如 JAR。

pre-integration-test - 在执行集成测试之前执行所需的操作。这可能涉及诸如设置所需环境之类的事情。

如果您想在不构建 jar 的情况下执行集成测试,您可以将它们配置为在test阶段执行。

test- 使用合适的单元测试框架运行测试。这些测试不应该要求打包或部署代码。

这可以通过使用executions和覆盖集成测试执行阶段来实现。如何让我的 Maven 集成测试运行

于 2017-01-26T16:16:18.757 回答