share | follow | edited Dec 27 '18 at 20:50. martieva. Maven builds the jar in a way that allows you to specify your library directory, so that your different projects can share library (jar) files. asked Aug 4 '10 at 23:03. This library need to be in the classpath. David David. The de facto build tool for Jenkins plugins is Apache Maven. With Maven we don’t have to do these steps. If you want to create a JAR file that includes your code along with all your dependencies, then use the assembly plugin with the jar-with-dependencies descriptor. it will not work because it will override the current classpath (that includes all the dependencies) Please help me. - markkolich/blog Start by opening your pom.xml file and add the Commons email dependency to the project. Example Create a simple project. The resultant jar is also called 'fat jar'. Using Maven 2, is there a way I can list out the jar dependencies as just the file names? Apache Maven Assembly plugin allows to create an executable jar which includes all its dependencies within it. All examples here will use Maven. When you say "retrieve/build what I need", if you mean "put all the dependencies into one jar file", the answer is no. maven-2 jar classpath. Maven will generate a complete JAR file with all … In this tutorial we will be adding Apache Commons Email library as a dependency to our Maven project. App.java mvn dependency:build-classpath can list the jar files, but that will include the full path to their location in my local repository. If we were mot using Maven, we would download the slf4j jars and add it to the classpath. 129 4 4 silver badges 10 10 bronze badges. To enable plugins to use the rich array of libraries available in the Java ecosystem, and build on one another using plugin-to-plugin APIs, the Jenkins plugin extension mechanism goes beyond simple plugin manifests. Maven automatically does all these steps for us. Maven will bundle the dependencies into the right location. There are many like it, but this one is mine. Dependencies and Class Loading Jenkins has a complex, modular architecture. This is my blog. 2,822 8 8 gold badges 31 31 silver badges 45 45 bronze badges. What I need is essentially just a list of the file names (or the file names that the copy-dependencies goal copied). Create a project using maven-archetype-quickstart with following parameters. Only after that we would be able to compile any class file that has dependency for those classes in the jar.