简体   繁体   中英

Jenkins hpi plugin has too many jar files

I have created a new Jenkins plugin using netbeans. The plugin is working as expected, however the size of the .hpi file generated is too huge. I have only 1 jar file that needs to be added as a dependency.

However, when I see the .hpi that was generated by netbeans it has over 90 jar files. Ie It seems to be adding dependencies that are already available on Jenkins server.

The .hpi file is created by netbeans in the target directory of the project. After I deploy the .hpi using Manage plugins link, I can see the .hpi in the .jenkins/plugins directory. Some of the jar files from WEB-INF/lib folder of the plugin are:

aether-api-0.9.0.M3.jar
cdi-api-1.0.jar
commons-httpclient-3.1.jar
commons-logging-1.1.1.jar
doxia-decoration-model-1.0.jar
doxia-site-renderer-1.0.jar

Is there a way to restrict this/package it more elegantly so that the plugin only has the jars that are needed ? If yes, How can I do that using Netbeans ?

在构建插件之前,您是否清理了工件?

mvn clean
  • you keep only required dependencies on your POM file under your dependency section of POM
  • Cleanup old artifacts using as suggested by Stephane, before building your plugin.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM