Fixing missing Mule osgi dependencies when using maven

I created a normal mule project using the maven archetype, eg:

mvn mule-project-archetype:create -DgroupId=nl.iteye -DartifactId=mule-tests -DmuleVersion=2.2.1 -Dinteractive=false

Strangely, i got some missing dependencies on this project. The maven output shows me the following:

[INFO] Unable to find resource 'org.safehaus.jug:jug:pom:2.0.0-osgi' in repository central (http://central)
[INFO] Unable to find resource 'org.apache.santuario:xmlsec:pom:1.4.0' in repository central (http://central)
[INFO] Unable to find resource 'javax.script:groovy-engine:pom:1.1-osgi' in repository central (http://central)

I solved this by excluding the unknown dependencies and replace them with libraries with a slighly different naming.

Exclude the missing dependencies:

<dependency>
    <groupId>org.mule</groupId>
    <artifactId>mule-core</artifactId>
    <version>${mule.version}</version>
    <exclusions>
        <exclusion>
            <groupId>org.safehaus.jug</groupId>
            <artifactId>jug</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.mule.transports</groupId>
    <artifactId>mule-transport-cxf</artifactId>
    <version>${mule.version}</version>
    <exclusions>
        <exclusion>  <!-- declare the exclusion here -->
            <groupId>org.apache.santuario</groupId>
            <artifactId>xmlsec</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.mule.modules</groupId>
    <artifactId>mule-module-scripting</artifactId>
    <version>${mule.version}</version>
    <exclusions>
        <exclusion>  <!-- declare the exclusion here -->
            <groupId>javax.script</groupId>
            <artifactId>groovy-engine</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.mule.tests</groupId>
    <artifactId>mule-tests-functional</artifactId>
    <version>${mule.version}</version>
    <scope>test</scope>
    <exclusions>
        <exclusion>  <!-- declare the exclusion here -->
            <groupId>org.safehaus.jug</groupId>
            <artifactId>jug</artifactId>
        </exclusion>
    </exclusions>
</dependency>

Include replacement dependencies:

<dependency>
    <groupId>org.safehaus.jug</groupId>
    <artifactId>jug.osgi</artifactId>
    <version>2.0.0</version>
</dependency>
<dependency>
    <groupId>org.apache.santuario</groupId>
    <artifactId>xmlsec.osgi</artifactId>
    <version>1.4.0</version>
</dependency>
<dependency>
    <groupId>javax.script</groupId>
    <artifactId>groovy-engine.osgi</artifactId>
    <version>1.1</version>
</dependency>

Anybody know an easier way to do this, or maybe a repository which contains the missing dependencies?

blog comments powered by Disqus