0

We are developing Java Rundeck plugins using 3rd party dependency jars using maven.

Is there any best way to add the required 3rd party dependency jars in the plugin jar.

In our case we are using jersey-client.jar. The pom.xml section is given below.

Pom.xml:

<plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
            <execution>
                <phase>package</phase>
                <goals>
                    <goal>copy-dependencies</goal>
                </goals>
                <configuration>
                    <outputDirectory>${project.build.directory}/lib</outputDirectory>

                </configuration>
            </execution>
        </executions>
    </plugin>

  <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                           <Rundeck-Plugin-Archive>true</Rundeck-Plugin-Archive>
                            <Rundeck-Plugin-Classnames>com.virginmedia.rundeck.APICallJava</Rundeck-Plugin-Classnames>
                            <Rundeck-Plugin-File-Version>${project.version}</Rundeck-Plugin-File-Version>
                            <Rundeck-Plugin-Version>1.2</Rundeck-Plugin-Version>
                            <Rundeck-Plugin-Libs>lib/jersey-client-1.8.jar</Rundeck-Plugin-Libs> 
                        </manifestEntries>
                    </archive>
                    <resources>
    <resource>
        <directory>${project.build.directory}/lib</directory>
        <includes>
            <include>**/*.jar</include>
        </includes>
    </resource>
</resources>
</configuration>
</plugin>

Note: Java Rundeck Plugin works fine when we use with Rundeck’s runtime jars.

Venkat
  • 1

1 Answers1

0

Maybe answered before. Using fat-jar you can integrate your dependencies, also, take a look at this.

MegaDrive68k
  • 3,768
  • 2
  • 9
  • 51