maven plugin requires unused jar

109 views Asked by At

I am trying to use jaxrs-raml-maven-plugin in our maven project and can't understand why the plugin configured in one module requires a class from another module, which is not on the classpath.

I am trying to generate RAML for existing jersey controllers. We are trying to isolate our internal beans/DAOs, and we intentionally exclude internal Basket from the module that contains jersey resources. You will not find it using mvn dependency:tree. However, when I try to build the module I am getting:

[ERROR] Failed to execute goal org.raml.plugins:jaxrs-raml-maven-plugin:1.3.4:generate-raml (default) on project bapi-api: Execution default of goal org.raml.plugins:jaxrs-raml-maven-plugin:1.3.4:generate-raml failed: A required class was missing while executing org.raml.plugins:jaxrs-raml-maven-plugin:1.3.4:generate-raml: com/somepackage/api/basket/Basket

Basket class is located in the module that is explicitly excluded from the classpath:

        <dependency>
        <groupId>com.neededmodule.bapi</groupId>
        <artifactId>bapi-transformer</artifactId>
        <exclusions>
            <exclusion>
                <groupId>com.modulethatcontainsbasketclass.bapi</groupId>
                <artifactId>booking-basket-api</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

I have already reported it in here, but the question to SO community is more general:

How can a maven plugin ask for the classes that are not required by the module itself?

0

There are 0 answers