2

When I am using mule-maven-plugin version 3.5.4 I am able to successfully build and run a project in anypoint studio but for the same project when I update the mule-maven-plugin version to 3.8.0 , it is raised an error, ${error.customerror.type} is dynamically used in a raise error component as well as in on-error propogate component which works well with mule-maven 3.5.4 but not with 3.8.0

Failed to execute goal org.mule.tools.maven:mule-maven-plugin:3.8.0:process-classes (default-process-classes) on project dna-db-system-api-v1: Fail to compile: There's no MULE error named '${ERROR.CUSTOMERROR.TYPE}'

According to release notes 3.8.0 and 3.5.4 I have all the mentioned requirements configured in my pc and project.

pom.xml

    <name>dna-db-system-api</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

        <app.runtime>4.4.0-20230217</app.runtime>
        <mule.maven.plugin.version>3.8.0</mule.maven.plugin.version>
        <munit.version>2.3.12</munit.version>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.mule.tools.maven</groupId>
                <artifactId>mule-maven-plugin</artifactId>
                <version>${mule.maven.plugin.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <sharedLibraries>
                        <sharedLibrary>
                            <groupId>com.oracle.ojdbc</groupId>
                            <artifactId>ojdbc8</artifactId>
                        </sharedLibrary>
                    </sharedLibraries>
                    <cloudHubDeployment>
                        <uri>https://anypoint.mulesoft.com</uri>
                        <muleVersion>${MULE_VERSION}</muleVersion>
                        <connectedAppClientId>${connectedAppClientID}</connectedAppClientId>
                        <connectedAppClientSecret>${connectedAppClientSecret}</connectedAppClientSecret>
                        <connectedAppGrantType>client_credentials</connectedAppGrantType>
                        <applicationName>${MULE_APP_NAME}</applicationName>
                        <region>${MULE_REGION}</region>
                        <workers>${MULE_WORKER}</workers>
                        <workerType>${MULE_WORKER_TYP}</workerType>
                        <environment>${ANYPOINT_ENVIRONMENT}</environment>
                        <objectStoreV2>true</objectStoreV2>
                        <businessGroupId>${project.groupId}</businessGroupId>
                        <properties>
                            <MULE_ENV>${MULE_ENV}</MULE_ENV>
                            <MULE_KEY>${MULE_KEY}</MULE_KEY>
                            <anypoint.platform.config.analytics.agent.enabled>true</anypoint.platform.config.analytics.agent.enabled>
                            <anypoint.platform.client_id>${ANYPOINT_CLIENT_ID}</anypoint.platform.client_id>
                            <anypoint.platform.client_secret>${ANYPOINT_CLIENT_SECRET}</anypoint.platform.client_secret>
                        </properties>
                    </cloudHubDeployment>
                    <classifier>mule-application</classifier>
                </configuration>
            </plugin>
        </plugins>
    </build>

Here I am using inbuilt embedded maven configuration in anypoint studio

Maven-Inbuilt

Here is java version and maven version of my pc

java-maven

In Environment variables java and maven is configured properly as required. I wonder if something is conflicting or something is missing in installations or something is wrongly configured. Please provide some suggestions

Karthik
  • 2,181
  • 4
  • 10
  • 28
  • Can you stay on 3.5.4 ? Is it necessary to upgrade to 3.8.0 – vikingsteve Mar 29 '23 at 07:38
  • @vikingsteve ya I can stay but just wanted to understand if I am doing anything wrong. its just higher version will have some important updates/bug-fixes so was trying it out – Karthik Mar 29 '23 at 07:52
  • 1
    Sometimes maven dependencies dont work together. If you have a good version of the plugin that satisfies your needs, you can always stick with it. Failing that raise it with the developer of the plugin... – vikingsteve Mar 29 '23 at 08:09
  • Please avoid using screenshots for text. – aled Mar 29 '23 at 11:43

1 Answers1

1

The error indicates that the build doesn't like an error defined with a property placeholder instead of a literal one. This may be a new validation or may be a bug. It doesn't has anything to do with dependencies. Try with the latest release of the Mule Maven Plugin available to see if that works. If not open a Support case with MuleSoft to report the issue.

aled
  • 21,330
  • 3
  • 27
  • 34
  • I tried and it didn't work with any mule maven versions greater than 3.5.4 @aled – Karthik Mar 29 '23 at 10:28
  • I believe the issue is related to the AST generation from Mule Maven Plugin 3.6.0+. Apparently it doesn't support an error in a placeholder. I recommend to report the issue to MuleSoft. – aled Mar 29 '23 at 14:23