2

I added a dependency to a Maven project (Scala based) but after recompiling it the new package can't be found. The new dependency looks as follows:

<dependency>
    <groupId>org.apache.any23</groupId>
    <artifactId>apache-any23</artifactId>
    <version>0.7.0-incubating</version>
</dependency>

Now when I

import org.apache.any23._

I get

Error: object any23 is not a member of package org.apache

Anybody an idea what the problem may be?

1 Answer 1

2

Look in your .m2/repository directory for the jar file. E.g. in OSX Terminal or Linux:

find ~/.m2 -print

Then use unzip or jar to list the contents:

jar tf filename

and look for the general package/class names.

You will most likely discover the problem, whatever it is, by looking for the file and contents.

Update: I just looked, it seems that you likely want the core artifact instead:

artifactId: apache-any23-core

it has JAR files, which are more likely to contain what you want: classes.

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

4 Comments

"find ~/.m2 -print | grep any23" returns nothing
I'd say you found your problem. Find a maven repository that has the files you want and add that to your <repositories> section. Just looked and that is the correct dependency name. Found it at repo1.maven.org/maven2/org/apache/any23/apache-any23/…
Ok, I changed the artifactId to core, validated and compiled the project. Nothing changed :(
Do my original steps again. This works fine for me, and I end up with a jar file that has the code desired: <dependency> <groupId>org.apache.any23</groupId> <artifactId>apache-any23-core</artifactId> <version>0.7.0-incubating</version> </dependency>

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.