Maven Dependency missing artifact : jhotdraw - java

I am currently working on a Java project using Maven. In my pom.xml I am getting this error.
Missing artifact org.jhotdraw:jhotdraw:jar:6.0b1
I have added this dependency
<dependency>
<groupId>org.jhotdraw</groupId>
<artifactId>jhotdraw</artifactId>
<version>7.6.0</version>
</dependency>
to my pom.xml. But still the error is same.
Can someone help me?

That version of org.jhotdraw.jhotdraw does not exist on Maven Repository, the last version available on Maven Repository is 7.4.1
Either you have made an error as to the version or group id (I see there is a 7.6.0 package under org.opentcs.thirdparty.jhotdraw, but don't know if it's the same). Alternatively, you may have to manually download and install that package, check out...
How to include custom library into maven local repository

Related

Add jnetpcap to maven fails

I try to add jnetpcap as a dependency to maven. I found on the internet the following that should be added to the pom file:
<dependency>
<groupId>jnetpcap</groupId>
<artifactId>jnetpcap</artifactId>
<version>1.4.r1425-1g</version>
</dependency>
I tried this with multiple version numbers, but maven can't find the version:
Dependency 'jnetpcap:jnetpcap:1.4.r1425-1g' not found (the version
is colored red).,
Also I tried to add the library via the project structure in IntelliJ. The Maven repository can find the jnetpcap library but when I try to import it i get:
No files were downloaded for jnetpcap:jnetpcap:1.4.r1425-1g.
The library can be manually imported via the jnetpcap.jar file but I need it as a maven dependency in my pom for creating a jar file of my project. Otherwise I get a jar file which can't execute since it is missing the dependency.
Does somebody know how I can include the dependency or otherwise how I can create a jar file of my project without missing this dependency?
The artifact is correct, however you are missing one little detail which is obvious, looking at the info page at mvnrepository.com:
https://mvnrepository.com/artifact/jnetpcap/jnetpcap/1.4.r1425-1g
Especially look at the table line Repositories. There you will see that this artifact is only listed in the "Clojars" repository, a non-standard repository you most likely have not added to your project.
Therefore adding the dependency is not enough, you also have to add the following section:
<repositories>
<repository>
<id>Clojars</id>
<name>Clojars</name>
<url>https://clojars.org/repo/</url>
</repository>
</repositories>
The version of the jar you are requesting is not published to the maven repository.
This would work
<dependency>
<groupId>jnetpcap</groupId>
<artifactId>jnetpcap</artifactId>
<version>1.4.r1425-1g</version>
</dependency>

Intellij Maven dependency not found (sqlite-jdbc)

IntelliJ Maven pom.xml I get the following message:
Dependency org.xerial:sqlite-jdbc:3.8.11.1 not found.
How can I fix my problem? This is the only dependency in my pom.xml which doesn't work.
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.8.11.1</version>
</dependency>
after testing in a new Maven Test Project, it works now in my main projec. Thank
Check correctness artifact properties as group artifact and version, if they correct this mean your artifact is not in maven central repo you need manually add new repository in you pom.xml where this artifact present. If you artifact in maven central try to load them manually if you use maven not bundled in intellij install
-> open console in idea with alt + f12 then type mvn dependency:resolve
update
your artifact in central repo, https://mvnrepository.com/artifact/org.xerial/sqlite-jdbc/3.8.11.1
Sometimes i meet this bug in Idea (Idea does not see this dependency because it does not indexed by Idea or something like this, version of artifact highlight red but it is only idea deal) add manually this dependency or try to recheck (clear caches) and all will be work.

What correct maven dependencies to specify for JBehave tutorial project?

I want to study the java spring portion of the Jbehave-tutorial project at https://github.com/jbehave/jbehave-tutorial.
The README.MD states the REQUIREMENTS for building at the bottom:
Building the tutorial has been tested with Maven 3.0.5-3.2.1 and JDK 1.6-1.7. Newer versions of Maven and JDK should work but could also present issues.If you find any, please report them via JIRA
On my computer My Computer I am running Maven Version: 3.3.3 and STS Version: 3.6.4 for 64-bit Windows 7.
I really don't want to make an Atlassian account in order to resolve this issue if I can resolve it on StackOverflow.
So these are the steps I took to build JBehave-tutorial on my machine:
git clone https://github.com/jbehave/jbehave-tutorial.git
mvn clean install -Pstable # Issued in the main parent folder 'jbehave-tutorial'
Imported into Spring Tool Suite (STS) as an existing maven project.
Received the following errors in STS:
This lead me to believe that maven did not correctly download and build those dependencies so I looked into the .m2\repository\org\jbehave folder and this is what I seen.
Did anybody else get this to work?
What workarounds are there?
What correct maven dependencies to specify for JBehave tutorial project in pom.xml(s)?
I'm not immediately clear on your specific situation but here are dependencies required to use JBehave without Spring. (example pom below - you'll only need gherkin if your user scenarios are in gherkin).
https://stackoverflow.com/questions/30685909/jbehave-dependencies-not-available-in-central-maven-repo
I'm also going to hazard a guess that you're going to need the below at the appropriate version.
<dependency>
<groupId>org.jbehave</groupId>
<artifactId>jbehave-spring</artifactId>
<version>4.0.3</version>
</dependency>
Maven cannot find "SNAPSHOT" dependencies.
You need to google "Maven + dependency name without specified version" and check what is the latest version of them and make appropriate changes in pom file.
For example I have jbehave-web-runner version 3.6-beta-2 NOT 3.6-SNAPSHOT.

Add feed4j dependency in pom.xml

I cannot add a dependency in pom.xml for feed4j.jar
When I select a dependency for feed4j I get feed4junit but not the feed4j.
When I add a dependency in pom.xml
<dependency>
<groupId>feed4j</groupId>
<artifactId>feed4j</artifactId>
<version>1.0</version>
</dependency>
I get an error
Missing artifact feed4j:feed4j:jar:1.0
As a result when I try mvn clean install I get an error
package it.sauronsoftware.feed4j does not exist
Any help please.
Feed4j is not in the Maven central repository. You have several options:
Use a Maven repository which has the feed4j artifact available. You can set up your own Nexus or Artifactory.
Include the jar file in your project and use the maven system scope (see this SO question for an example how to use it)
Install the dependency manually in your local Maven repository. Here is a short tutorial how to do that.
Eventually, i found the answer here but feed4j is not included in the repository.jboss that's why I used the pentaho-releases.

how to get maven to update a specific version dependency

i'm kinda new to maven after coming from a simple yet uncouth ant world.
<dependencies>
<dependency>
<groupId>com.foo.bar.EPT</groupId>
<artifactId>EPTUtils</artifactId>
<version>1.2.9-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
I'm looking for a maven command to specifically update this version to 1.2.14-SNAPSHOT. I've tried
mvn -DallowSnapshots=true versions:use-latest-snapshots -Dincludes=com.foo.bar.*
but that didn't update what i had in my local repo.
Change
<version>1.2.9-SNAPSHOT</version>
to
<version>1.2.14-SNAPSHOT</version>
in the pom.xml of your Maven project. Then build the project.
mvn clean test package
Maven will download the dependency and store it in your local ~/.m2 repository.
Edit: Also see How do I tell Maven to use the latest version of a dependency? for more information about Maven and latest versions.
Edit 2: You can use the Versions Maven Plugin that as goals that can help you with that.

Categories