Vegard
Vegard

Reputation: 5072

Java EE Provided dependencies in Hudson / Jenkins

I'm trying to build a Maven based Java EE project on Jenkins, but I'm getting compilation errors. The reason seems to be that the Java EE dependencies that are marked as provided in the POM logically enough aren't downloaded when the project is built.

How can I set up the POM so that the build works in Jenkins, but the EE dependencies aren't included in the WAR file?

My thanks in advance for any input you can provide.

Upvotes: 0

Views: 597

Answers (2)

Montolide
Montolide

Reputation: 792

Not sure if its the best solution, but you can add EE dependencies with scope "provided", like the example:

    <dependency>
        <groupId>org.apache.tomcat</groupId>
        <artifactId>tomcat-servlet-api</artifactId>
        <version>7.0.27</version>
        <type>jar</type>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.el</groupId>
        <artifactId>javax.el-api</artifactId>
        <version>2.2.4</version>
        <type>jar</type>
        <scope>provided</scope>
    </dependency>

Maybe there is a plugin who provides all of them to you, but I'm not sure about that.

Hope that helps

Upvotes: 0

Shivan Dragon
Shivan Dragon

Reputation: 15219

That's strange, AFAIK the dependencies with scope "provided" are simply not placed in the built file, they should however be downloaded. Are you sure your Maven is correctly configured to download dependencies - maybe there's a proxy that's not configured.

Upvotes: 4

Related Questions