mulepom.xmlmulesoftmule4munit

Error in azure devops pipeline when Munits are not skipped for Mule4


Encountered below error in azure devops pipelines when Munits are included (i.e. we don't skip the Munits).

ERROR 2022-06-15 08:37:49,325 [Embedded] org.mule.runtime.module.deployment.internal.DefaultArchiveDeployer:

2022-06-15T08:37:49.3334578Z ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

2022-06-15T08:37:49.3335465Z + Failed to deploy artifact                                +

2022-06-15T08:37:49.3336605Z + 'api-gateway-sample-wsdl-proxy', see below               +

2022-06-15T08:37:49.3337593Z ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

2022-06-15T08:37:49.3339247Z org.mule.runtime.api.exception.MuleRuntimeException: Artifact secure-properties requires a newest runtime version. Artifact required version is 4.2.0 and Mule Runtime version is 4.1.1

2022-06-15T08:37:50.9761979Z [INFO] ====================================================================================

2022-06-15T08:37:50.9764107Z [INFO] MUnit Run Summary - Product: MULE, Version: 4.1.1

2022-06-15T08:37:50.9765113Z [INFO] ====================================================================================

2022-06-15T08:37:50.9867345Z [INFO]  >> wsdl-proxy-test-suite.xml (No tests run) <<< ERROR (org.mule.munit.remote.exception.DeploymentExceptio...)

2022-06-15T08:37:50.9872696Z [INFO]  

2022-06-15T08:37:50.9921133Z [INFO] ====================================================================================

2022-06-15T08:37:50.9922397Z [INFO]  > Tests:        0

2022-06-15T08:37:50.9923046Z [INFO]  > Errors:       0

2022-06-15T08:37:50.9923631Z [INFO]  > Failures:     0

2022-06-15T08:37:50.9924229Z [INFO]  > Skipped:      0

Tried updating the versions in pom.xml and mule-artifact.json but didn't help. Am I missing anything? What needs to be the compatible version to run the pipeline successfully.

Snippet from pom.xml-

<project xmlns=http://maven.apache.org/POM/4.0.0 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd>
<modelVersion>4.0.0</modelVersion>

 

<groupId>org.mule.examples</groupId>
<artifactId>api-gateway-sample-wsdl-proxy</artifactId>
<version>2.0.1</version>

<packaging>mule-application</packaging>
<name>abc-app_name</name>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <app.runtime>4.3.0-20200824</app.runtime>
    <mule.maven.plugin.version>3.4.0</mule.maven.plugin.version>
    
    <munit.version>2.2.5</munit.version>
    <muleHttpConnector>1.5.17</muleHttpConnector>
    <muleCompressionModule>2.1.0</muleCompressionModule>
    <muleMavenPluginVersion>3.2.0</muleMavenPluginVersion>
    <proxyExtensionVersion>1.1.3</proxyExtensionVersion>
    <wsdlFunctionsExtension>1.1.3</wsdlFunctionsExtension>
    <soapFunctionsExtension>2.0.0</soapFunctionsExtension>
    <soap.validator.version>1.0.1</soap.validator.version>
    <attachMuleSources>true</attachMuleSources>
</properties>
<dependencies>
     <dependency>
        <groupId>com.mulesoft.modules</groupId>
        <artifactId>mule-secure-configuration-property-module</artifactId>
        <version>1.2.3</version>
        <classifier>mule-plugin</classifier>
    </dependency>
    <dependency>
        <groupId>com.mulesoft.munit</groupId>
        <artifactId>munit-runner</artifactId>
        <version>2.2.5</version>
        <classifier>mule-plugin</classifier>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>com.mulesoft.munit</groupId>
        <artifactId>munit-tools</artifactId>
        <version>2.2.5</version>
        <classifier>mule-plugin</classifier>
        <scope>test</scope>
    </dependency>
</dependencies>

Snippet from mule-artifact.json -

"redeploymentEnabled": true,
"name": "org.mule.examples:api-gateway-sample-wsdl-proxy:2.0.1",
"minMuleVersion": "4.1.0",
"requiredProduct": "MULE",
"classLoaderModelLoaderDescriptor": {
"id": "mule",

Solution

  • The error is that MUnit is trying to execute the test with Mule version 4.1.1 which is not compatible with the version of the Secure Properties module used by the project.

    It seems from the little we can see from the pom that the MUnit version used is not the latest release. Try upgrading to the latest release that is actually compatible with Mule 4 first.

    After that, if the error is still happening check if the configuration of the Maven Munit plugin is overriding the Mule version used to execute the tests with the <runtimeVersion> element.