Alex Rivera | Logout

Maven WAR dependency - cannot resolve package?

Asked 2011-04-08T15:29:36.737
19

I have a war dependency:

    <dependency>
        <groupId>my.package</groupId>
        <artifactId>myservices</artifactId>
        <version>0.3</version>
        <type>war</type>
    </dependency>

Now, this exists in my local repository, and the class exists at WEB-INF/classes/my/package/myservices. When I go to use myservices, however, I get package my.package does not exist. Intelli-J knows to change myservices into my.package.myservices, but trying to import seems to not work at all.

Is there something special I need to do with this war dependency?

Edit
Report

1 Answer

0

Make sure the dependency is installed in your local repository.
The local repo should look like:

.m2/my/package/myservices/0.3/myservices-0.3.war

If this is not the case, then install the war into the local repository before using it in the dependency:

mvn install:install-file -Dfile="[path-to-war]"  -DgroupId=my.package  -DartifactId=myservices -Dversion=0.3 -Dpackaging=war -DcreateChecksum=true -DgeneratePom=true
answered 2011-04-08T15:44:56.087

Your Answer