Skip to content
This repository was archived by the owner on Jan 20, 2024. It is now read-only.
This repository was archived by the owner on Jan 20, 2024. It is now read-only.

Shared java project that depends on mule libaries #78

@gilbertg

Description

@gilbertg

Hi, we have multiple Mule projects, and have created a shared project that contains utilities - some of which are dependent on Mule libraries. The Gradle file for this shared project look like this:

dependencies {
    compile project(':Shared')

    compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.3.2'
    compile group: 'javax.activation', name: 'activation', version: '1.1'
    compile group: 'javax.xml.stream', name: 'stax-api', version: '1.0-2'
    compile group: 'log4j', name: 'apache-log4j-extras', version: '1.2.17'
    compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5'
    compile group: 'commons-httpclient', name: 'commons-httpclient', version: '3.1'
}

eclipse.classpath.file {
    withXml { provider ->
        def root = provider.asNode()
        root.appendNode('classpathentry', [kind: 'con', path: 'MULE_RUNTIME', exported: 'true'])
    }
}

As you can see, I've forced Anypoint Studio to reference the MULE_RUNTIME container. This is 100% - the projects are referenced as expected, and Anypoint does not try to treat the common project as a Mule app. This also runs and deploys 100% through Anypoint Studio.
Below is the project structure;

  • esb is a mule project
  • ESBCommon is our shared project with Mule-enhancing utilities
  • Shared is a normal java project with no Mule dependencies

anypoint studio project structure

Problem comes in when we try to build through Gradle, the project (understandably) can't find any of the Mule dependencies. Can you suggest a way to include the Mule dependencies for the gradle build?

I'm trawling through your Gradle plugin, code, but suspect it will be some time before i understand enough of Gradle plugins, and the mechanisms of this project.

Thanks...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions