0

I'm not very familiar with maven and I'm struggling with this error message when running a maven compile:

[ERROR] Failed to execute goal on project myProject: Could not resolve dependencies for project myProject:1.0: Failure to find weka:weka:jar:3.7.1-beta in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1] 

The pom looks like this:

<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>myGroup</groupId> <artifactId>myProject</artifactId> <version>1.1</version> <repositories> <repository> <id>ambit-plovdiv</id> <url> http://ambit.uni-plovdiv.bg:8083/nexus/content/repositories/thirdparty</url> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.7</version> <scope>test</scope> </dependency> <dependency> <groupId>commons-collections</groupId> <artifactId>commons-collections</artifactId> <version>3.2.1</version> </dependency> <!-- general purpose math-libraries --> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-math</artifactId> <version>2.2</version> </dependency> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>2.4</version> </dependency> <dependency> <groupId>net.sf.opencsv</groupId> <artifactId>opencsv</artifactId> <version>2.1</version> </dependency> <dependency> <groupId>net.sourceforge.jtds</groupId> <artifactId>jtds</artifactId> <version>1.2.4</version> </dependency> <dependency> <groupId>net.sourceforge.jexcelapi</groupId> <artifactId>jxl</artifactId> <version>2.6.10</version> </dependency> <dependency> <groupId>tablelayout</groupId> <artifactId>TableLayout</artifactId> <version>20050920</version> </dependency> <dependency> <groupId>org.openscience.cdk</groupId> <artifactId>cdk</artifactId> <version>1.3.8</version> </dependency> <dependency> <groupId>org.openscience.cdk</groupId> <artifactId>jchempaint</artifactId> <version>3.0.1</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.7-beta1</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml-schemas</artifactId> <version>3.7-beta1</version> </dependency> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi-ooxml</artifactId> <version>3.7-beta1</version> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.0.2</version> <configuration> <source>1.6</source> <target>1.6</target> <optimize>true</optimize> <fork>true</fork> <compilerVersion>1.6</compilerVersion> <encoding>UTF-8</encoding> </configuration> </plugin> </plugins> </build> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> </project> 

Can anybody help to understand this error message?

3 Answers 3

3

It was Friday... I mixed up two maven projects. Thanks a lot for your help!

Sign up to request clarification or add additional context in comments.

Comments

0

First part of the message means that one of your (transitive) dependency is missing in your accessible repositories.

Second part means that it is not the first time this request has been made, so unless you un-blacklist it (with -U in your command for instance), Maven will not try to find it again on the remote repositories.

2 Comments

Running with a -U gives me this error: [ERROR] Failed to execute goal on project myProject: Could not resolve dependencies for project myProject:jar:1.0: Could not find artifact weka:weka:jar:3.7.1-beta in central (repo.maven.apache.org/maven2) -> [Help 1]
So clearly you should find and use a repo that contains that JAR, or download it and install it on your local/corporate repository. Some JARs are not available on the central repo, for various reasons (licensing notably...)
0

If you can upgrade, later versions of weka are in maven central.

Alternatively, as a last resort if you can't find the versions you need in a maven repo somewhere, you could download the jars you need from the weka site, and put them in your local repository, something like this:

mvn install:install-file -Dfile=weka-3.7.1-beta.jar -DgroupId=weka -DartifactId=weka -Dversion=3.7.1-beta -DgeneratePom=true 

2 Comments

How would I have to upgrade? Weka does not appear in my dependencies (anymore!) and I don't need it. But - it's still in my local repository from former times. I don't understand why maven is looking for it.
Presumably something you depend on has a dependency on weka - you could try running mvn dependency:tree in your project directory, this will print out a tree showing what depends on what, you will be able to see why it is looking for weka then.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.