0

I'm doing the XML SDK in Mule 4.2.2 with Maven 3.6.3 [though Mule inbuild using (3.6.9)] and AnypointStudio 7.4.2 . Please clarify my doubts

1) Is that XML SDK connectorPlugin creation is supported only in Mule-EE version or public?

2) I'm using the below Maven command and settings.xml , which is throwing 401 Unauthorized (Warning) and error as 'Archetype' issue.

 mvn archetype:generate -DarchetypeGroupId=org.mule.extensions -DarchetypeArtifactId=xml-mule-extensions-archetype -DarchetypeVersion=1.0.1 -DgroupId=org.mule.extension -DartifactId=error-handler-framework -DmuleConnectorName=ErrorHandler

Error I'm getting as below. But i can able to assess this URL https://repository.mulesoft.org/releases/ without Login. Not sure why its throwing 401

[WARNING] Failure to transfer org.mule.tools/maven-metadata.xml from 
https://repository.mulesoft.org/releases/ was cached in the local repository, resolution will not be reattempted until the update interval of mulesoft-releases has elapsed or updates are forced. Original error: Could not transfer metadata org.mule.tools/maven-metadata.xml from/to mulesoft-releases (https://repository.mulesoft.org/releases/): authenticationrequired (401)
[ERROR] No plugin found for prefix 'archetype' in the current project and in the plugin groups [org.mule.tools, org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\jxsubr\.m2\repository), mulesoft-releases (https://repository.mulesoft.org/releases/), central (https://repo.maven.apache.org/maven2)] 

Below is the settings.xml

          <?xml version="1.0"?>
        <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0  
         http://maven.apache.org/xsd/settings-1.0.0.xsd">
              <localRepository>C:\Users\star\.m2\repository</localRepository>  
         <profiles>
           <profile>
             <id>Mule</id>
             <activation>
               <activeByDefault>true</activeByDefault>
             </activation>
       <repositories>
         <repository>
             <id>mulesoft-releases</id>
             <name>MuleSoft Repository</name>
             <url>http://repository.mulesoft.org/releases/</url>
             <layout>default</layout>
         </repository>
     </repositories>
    </profile>
  <profile>
        <id>standard-repositories</id>
        <repositories>
            <repository>
                <id>Central</id>
                <name>Central</name>
                <url>http://repo1.maven.org/maven2/</url>
                <layout>default</layout>
            </repository>
            <repository>
                <id>mulesoft-releases</id>
                <name>MuleSoft Releases Repository</name>
                <url>http://repository.mulesoft.org/releases/</url>
                <layout>default</layout>
            </repository>
            <repository>
                <id>mulesoft-ee-release</id>
                <url>https://repository.mulesoft.org/nexus-ee/content/repositories/releases-ee/</url>
                <layout>default</layout>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>
        </repositories>
        <pluginRepositories>
            ..............
    </profile>

I also tried giving Public Repo, instead Mule-ee in the above settings. Still the same error. Please direct me a standard settings.xml for Mule if any.

3) Though Mule inbuild for this runtime 4.2.2 using Maven 3.6.9. Can we use lower version 3.6.3 (I believe this is the stable version now)?

Reference: https://docs.mulesoft.com/mule-sdk/1.1/xml-sdk

Thanks in advance for your help. Please let me know if needed more information.

star
  • 1,493
  • 1
  • 28
  • 61

2 Answers2

0

I think you need to declare the repos as pluginRepositories too for the archetype to work. HTH

afelisatti
  • 2,770
  • 1
  • 13
  • 21
  • Thanks. But it does seems to be work, same error. could you please pass me any sample Maven Mule settings? Also do you have any Idea, Mule `XML SDK` is EE specific?, I'm struggling to get it right.I tried Mule docs in the above, it have described part by part of Maven settings, not complete. – star Apr 05 '20 at 09:42
  • Looking at the docs you linked, it seems you are using an older version and artifact of the archetype (xml-mule-extensions-archetype 1.0.1 vs mule-extensions-xml-archetype 1.2.0): https://docs.mulesoft.com/mule-sdk/1.1/xml-sdk#create-and-test-an-xml-sdk-project – afelisatti Apr 06 '20 at 18:51
0

This dependency is available only for MuleSoft Enterprise Maven customer repository only. IN XML SDK other than transform message this ee xsd may not require., I have created a log forwarder without using this dependency. Log Forwarding Connector Mule XML-SDK - DZone https://dzone.com/articles/mule-log-forwarder-connector-xml-sdk

https://docs.mulesoft.com/mule-runtime/3.6/configuring-maven-to-work-with-mule-esb#%C2%A0referencing-mulesoft-s-enterprise-repositories.

Arghya Sadhu
  • 41,002
  • 9
  • 78
  • 107