1

I am trying to do a continuous build with Jenkins and trying to deploy those builds using Jenkins.

I have configured Jenkins free style job to check out code from SVN and Invoke top level maven target with pre-integration-test -P<environment>.

This job is building and deploying my SOA composites onto weblogic successfully. But I don't want to deploy my every build. I want to restrict my deployments onto the server.

If I configure Jenkins job to build my SOA with mvn clean package goal. How I can trigger my other Jenkins job to deploy the previously generated artifacts. We don't have any nexus/artifactory in our infrastructure. We store our builds in our Jenkins workspace.

I have configured two Jenkins jobs, one which builds the application using mvn clean package which will trigger other Jenkins job using mvn pre-integration-test. But here in my second job, the pre-integration-test is again starting from validating phase producing again my sar. Is there any plugin which deploys my sar without recompiling/rebuilding it again.

Please help me to solve this problem.

Here is my 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-instance">

<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>

aspire96
  • 141
  • 2
  • 11

1 Answers1

0

The reason that your second job build the entire jar again is because you are executing a goal pre-integration-test which includes the maven lifecycle phases prior to it

package - take the compiled code and package it in its distributable format, such as a JAR.

pre-integration-test - perform actions required before integration tests are executed. This may involve things such as setting up the required environment.

If in case you want to execute the integration tests without building the jar you can configure them to execute in the test phase.

test - run tests using a suitable unit testing framework. These tests should not require the code be packaged or deployed.

This can be achieved using executions and overriding the phase of integration tests execution. How do I get my Maven Integration tests to run

Community
  • 1
  • 1
Naman
  • 27,789
  • 26
  • 218
  • 353
  • Here, why I am using pre-integration-test goal because SOA/OSB deploys through this maven goal. please use this link to understand why I have used pre-integration-test to deploy my artifacts onto weblogic. https://docs.oracle.com/middleware/1213/osb/develop/GUID-F7B8638E-1BE5-44A8-9590-F34E2489625C.htm#GUID-3DFCD3C5-6A28-46AA-9E25-6186D56C47D2 – aspire96 Jan 26 '17 at 16:34
  • I don't know how to skip previous phases. I thought maven.package.skip=true may be helpful. But I didn't work out. – aspire96 Jan 26 '17 at 16:42