unable to call dependent module jar file to build main module's ear file from jenkins and aven

14 Views Asked by At

I am using jenkins and build tool is maven to build a bw6 module .ar file, to build that .ear file i need some dependent module's .jar file and those jar files are already build by some different jenkins build and now stored in artifact repo.

How can i call that .jar file while building through jenkins? this is my parent pom file

?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.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>
  <groupId>com.tibco.bw</groupId>
  <artifactId>APPLICATION_NAME.application.parent</artifactId>
  <version>1.0.0-SNAPSHOT</version>
  <packaging>pom</packaging>
  <modules>
      
    <module>../APPLICATION_NAME</module>
    <module>../APPLICATION_NAME.application</module>
  </modules>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.7.1</version>
      </plugin>
      <plugin>
        <groupId>io.fabric8</groupId>
        <artifactId>docker-maven-plugin</artifactId>
        <version>0.34.1</version>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
      <plugin>
        <groupId>io.fabric8</groupId>
        <artifactId>fabric8-maven-plugin</artifactId>
        <version>4.4.1</version>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

also this is my jenkinsfile

pipeline {
    agent {
        kubernetes {
            cloud 'openshift'
            yamlFile 'build.yaml'
        }
    }

    environment {
        IMAGE_NAME = 'docker.repo.org.com/org/tibco/orgname/repo-name'
    }

    stages {

        stage('Dependency Report') {
            steps {
                container('java') {
                 
                    sh 'mvn --batch-mode --show-version --fail-at-end versions:display-property-updates --no-snapshot-updates -f APPLICATION_NAME.application.parent'
                }
            }
        }

        stage('Product Build') {
            steps {
                container('java') {
            sh 'cd EIFDBAdapter.application.parent'
                    sh 'mvn --batch-mode --show-version --fail-at-end package'
                }
            
0

There are 0 best solutions below