question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not able to download jar using maven dependency and getting error No class found

See original GitHub issue

Hi, I am trying to use this library. For this, I have included dependency in my maven project.

<dependency>
			<groupId>com.cdancy</groupId>
			<artifactId>jenkins-rest</artifactId>
			<version>0.0.14</version>
		</dependency>

However, I was getting missing artifact error. So I just saw in .m2 folder and found there is no jar. Only 4 other files were there. So I downloaded JAR manually and added in class path. Now, I added basic code that is given in READ.md. Then I am getting following error :

Exception in thread "main" java.lang.NoClassDefFoundError: org/jclouds/apis/ApiMetadata
	at com.ks.App.main(App.java:13)
Caused by: java.lang.ClassNotFoundException: org.jclouds.apis.ApiMetadata
	at java.net.URLClassLoader.findClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	... 1 more

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
tbouffardcommented, Jan 20, 2020

@shubhashi88 according to the maven error log, the groupId of the jenkins-rest dependency seems wrong: you are using jenkins-rest and the README states to use com.cdancy I suggest you to declare the jenkins-rest dependency in your pom.xml file as in the following

<dependency>
  <groupId>com.cdancy</groupId>
  <artifactId>jenkins-rest</artifactId>
  <version>0.0.22</version>
</dependency>
2reactions
tbouffardcommented, Jan 17, 2020

@shubhashi88 according to your maven logs, maven is unable to find the lib, probably because your local maven installation is not aware of the JCenter repository (or you use a corporate repository manager not aware of it)

Please add the JCenter repository to your pom.xml or local settings.xml with something like in the following Resources: https://maven.apache.org/guides/introduction/introduction-to-repositories.html

<repositories>
    <repository>
      <id>jcenter</id>
      <url>https://jcenter.bintray.com/</url>
    </repository>
</repositories>
Read more comments on GitHub >

github_iconTop Results From Across the Web

NoClassDefFoundError on Maven dependency - Stack Overflow
By default, Maven doesn't bundle dependencies in the JAR file it builds, and you're not providing them on the classpath when you're trying ......
Read more >
Geotools with maven: java.lang.noclassdeffounderror while ...
I have to notice that during the build there was error messages about all GTs jars: [WARNING] The POM for org.geotools:gt-shapefile:jar:sources: ...
Read more >
Maven Getting Started Guide
The first time you execute this (or any other) command, Maven will need to download all the plugins and related dependencies it needs...
Read more >
3 ways to solve java.lang.NoClassDefFoundError in Java J2EE
NoClassDefFoundError in Java comes when Java Virtual Machine is not able to find a particular class at runtime which was available at compile...
Read more >
Spring Boot, Maven and Eclipse Errors and TroubleShooting ...
Q : How can you always exclude a specific jar using Maven Exclusions? ... ClassNotFoundException; Q : Why are we not using Gradle?...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found