Could not find imported resource during MuleSoft build

217 Views Asked by At

I have mule-artifact.json containing

"configs": [
   "global.xml", "flow.xml"
],

In global.xml I have

<import file="connectors/global-connectors.xml" />

After I've updated

<plugin>
    <groupId>org.mule.tools.maven</groupId>
    <artifactId>mule-maven-plugin</artifactId>
    <version>${mule.maven.plugin.version}</version>
    <extensions>true</extensions>
    <configuration>
        <classifier>mule-application</classifier>
    </configuration>
</plugin>

from 3.5.4 to 4.0.0 I have the following error:

[ERROR] Failed to execute goal org.mule.tools.maven:mule-maven-plugin:4.0.0:process-classes (default-process-classes) on project mule-project: Fail to compile: Could not find imported resource 'connectors/global-connectors.xml' -> [Help 1]

My maven is 3.9.5. I build project via mvn clean package -DskipTests.

If I insert contents from connectors/global-connectors.xml to global.xml I have another import error, if I remove another import then build is successful.

I didn't find what is changed in mule-maven-plugin 4.0.0.

1

There are 1 best solutions below

0
On

Ensure that the global-connectors.xml is correctly placed in the resource path as expected by the Mule application. In Mule 4, the default resource path is src/main/resources. If your connectors are not in this directory, the plugin might not be able to locate them.