user1079425
user1079425

Reputation:

2 missing dependencies when including a jar with maven

I'm working on a web-app, and in order to minimise the number of dependencies in it's pom.xml, I have created a jar with all the dependencies needed.

but when adding this jar dependency on my web project, it seems that 2 existing dependencies on the jar are not being included in my web-app.

pom.xml of my web app :

<!-- rest-easy-api -->
<dependency>
    <groupId>rest-easy-api</groupId> 
    <artifactId>rest-easy-api</artifactId>
    <version>1.0</version>
    <scope>provided</scope>
</dependency>

The 2 missing dependencies (which are included in my jar) :

<!-- EclipseLink's JPA capabilities for relational databases. -->
<dependency>
    <groupId>org.eclipse.persistence</groupId>
    <artifactId>eclipselink</artifactId>
    <version>2.5.2</version>
    <scope>provided</scope> 

    <exclusions>
        <exclusion>
            <groupId>org.eclipse.persistence</groupId>
            <artifactId>commonj.sdo</artifactId>
        </exclusion>
    </exclusions>
</dependency> 

<!-- JPA 2.1 -->
<dependency>
    <groupId>org.eclipse.persistence</groupId>
    <artifactId>javax.persistence</artifactId>
    <version>2.1.0</version>
    <scope>provided</scope>
</dependency>

it's like the local repository is not updated.. I did clean both projects, removed them - re-import them. It still doesn't work..

Do you guys have any idea about what could be the reason of this ?

Thanks,

Upvotes: 0

Views: 703

Answers (2)

cowls
cowls

Reputation: 24334

Remove

<scope>provided</scope> 

That tells maven that the dependency will be provided by the runtime environment, so it will not be pulled into this build but only used at compile time.

Upvotes: 1

Apokai
Apokai

Reputation: 359

Did you try to remove the provided scope, just for reimporting them into your local repo?

Upvotes: 0

Related Questions