How to connect mule repository? - maven

I'm getting below when i run my mule interface.
[ERROR] Failed to execute goal on project apl-integration: Could not resolve dependencies for project com.katalystm:apl-integration:mule:1.0.0-PRE: Failed to collect dependencies at com.mulesoft.muleesb:mule-core-ee:jar:3.7.0: Failed to read artifact descriptor for com.mulesoft.muleesb:mule-core-ee:jar:3.7.0:
Could not transfer artifact com.mulesoft.muleesb:mule-core-ee:pom:3.7.0 from/to mulesoft-releases (http://repository.mulesoft.org/releases/): Connect to repository.mulesoft.org:80 [repository.mulesoft.org/52.7.200.18] failed: Connection timed out: connect -> [Help 1]
Seem it is failed to connect the http://repository.mulesoft.org/releases/, i have added the repository even in my POM file aslo.
<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-snapshots</id>
<name>MuleSoft Snapshots Repository</name>
<url>http://repository.mulesoft.org/snapshots/</url>
<layout>default</layout>
</repository>
</repositories>

Please add this repository
<repository>
<id>codehaus-mule-repo</id>
<name>codehaus-mule-repo</name>
<url>
https://repository-master.mulesoft.org/nexus/content/groups/public/
</url>
<layout>default</layout>
</repository>

Related

Unable to download maven fmt-maven-plugin dependency

I am trying to add fmt-maven-plugin (https://mvnrepository.com/artifact/com.coveo/fmt-maven-plugin/2.13) as dependency so I added below code in my POM xml file
<dependency>
<groupId>com.coveo</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.13</version>
</dependency>
Also I have below repo details in my settings.xml
<profile>
<id>maven-https</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
But I get below error while running build,
[ERROR] Plugin com.spotify.fmt:fmt-maven-plugin:2.13 or one of its dependencies could not be resolved: Could not find artifact com.spotify.fmt:fmt-maven-plugin:jar:2.13 in central (https://repo1.maven.org/maven2) -> [Help 1]
My understanding is maven could not download fmt-maven-plugin:2.13 from given https://repo1.maven.org/maven2 repo but I am not sure what repo to add in order to download fmt-maven-plugin. Can anyone suggest me?

MuleSoft Maven Build Failure Using TFS Build Release

We are using TFS GIT and trying to build the project and getting below error (the same code works fine on my local when i do mvn clean install but fails in tfs server):
Unresolveable build extension: Plugin org.mule.tools.maven:mule-maven-plugin:3.3.5 or one of its dependencies could not be resolved: Failed to collect dependencies at org.mule.tools.maven:mule-maven-plugin:jar:3.3.5 -> org.mule.tools.maven:mule-packager:jar:3.3.5 -> org.mule.tools.maven:mule-classloader-model:jar:3.3.5 -> commons-io:commons-io:jar:2.6: Failed to read artifact descriptor for commons-io:commons-io:jar:2.6: Could not transfer artifact commons-io:commons-io:pom:2.6 from/to central (http://repo1.maven.org/maven2): Failed to transfer file http://repo1.maven.org/maven2/commons-io/commons-io/2.6/commons-io-2.6.pom with status code 501 -> [Help 2]
2020-07-01T16:27:19.7473940Z org.apache.maven.plugin.PluginManagerException: Plugin org.mule.tools.maven:mule-maven-plugin:3.3.5 or one of its dependencies could not be resolved: Failed to collect dependencies at org.mule.tools.maven:mule-maven-plugin:jar:3.3.5 -> org.mule.tools.maven:mule-packager:jar:3.3.5 -> org.mule.tools.maven:mule-classloader-model:jar:3.3.5 -> commons-io:commons-io:jar:2.6
Agree with khmarbaise.
I encountered into the same problem when I used Central Repository with http communication.
To solve this issue, you need to change the reference of Central Repository in the Pom file to https communication.
For example:
<Project>
....
<pluginRepositories>
<pluginRepository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo1.maven.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
</pluginRepository>
</pluginRepositories>
<repositories>
<repository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo1.maven.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
....
</project>
Then the Maven task could work as expected.
Hope this helps.

Artifactory OSS throwing 405 Exception when running maven release:perform

artifactory-oss-6.7.2 is throwing a 405 status code exception when running maven release:perform
Created a settings.xml from artifactory "generate settings.xml" on repo. All repos are virtual repos. Added distributionManagement to my project pom file to use the ids for snapshots and releases from settings.xml.
settings.xml:
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>http://localhost:8081/artifactory/libs-release</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://localhost:8081/artifactory/libs-snapshot</url>
</repository>
</repositories>
myproject/pom.xml:
<distributionManagement>
<repository>
<id>central</id>
<name>Artifactory Release Repo</name>
<url>http://localhost:8081/artifactory/libs-release</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>Artifactory Snapshot Repo</name>
<url>http://localhost:8081/artifactory/libs-snapshot</url>
</snapshotRepository>
</distributionManagement>
run mvn release:perform output:
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project model: Failed to deploy artifacts: Could not transfer artifact com.test:model:jar:0.1.0 from/to central (http://localhost:8081/artifactory/libs-release): Failed to transfer file http://localhost:8081/artifactory/libs-release/com/srcrea/model/0.1.0/model-0.1.0.jar with status code 405 -> [Help 1]
So I followed something I found here -> http://forums.jfrog.org/Error-Code-405-with-mvn-deploy-td7174367.html
And updated DistributionManagement of the pom.xml
<distributionManagement>
<repository>
<id>central</id>
<name>Artifactory Release Repo</name>
<url>http://localhost:8081/artifactory/88888</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>Artifactory Snapshot Repo</name>
<url>http://localhost:8081/artifactory/88888</url>
</snapshotRepository>
</distributionManagement>
Re-Run and now I see it:
But what is not clear is in order to generate settings.xml you need to associate virtual repos to a local repo. Then generate settings off that and use the distributionManagement configuration to point back to the local repo. What is the point of the virtual repo?

Error building with Service Now connector v5.0.0 for Mule 3.7.1

I've been trying to do some tests with the new ServiceNow connector and Mule 3.7.1 but when I try to build the project and run it, it fails with the following error:
Failed to execute goal on project xxx: Could not resolve dependencies for project xxx:mule:0.0.1-SNAPSHOT: Failed to collect dependencies at org.mule.modules:mule-module-servicenow:jar:5.0.0: Failed to read artifact descriptor for org.mule.modules:mule-module-servicenow:jar:5.0.0: Could not transfer artifact org.mule.modules:mule-module-servicenow:pom:5.0.0 from/to mule-ee-releases (https://repository-master.mulesoft.org/nexus/content/repositories/releases-ee/): Not authorized , ReasonPhrase:Unauthorized. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
I believe I have added the correct information into the correct sections in pom.xml
<inclusion>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-servicenow</artifactId>
</inclusion>
<dependency>
<groupId>org.mule.modules</groupId>
<artifactId>mule-module-servicenow</artifactId>
<version>5.0.0</version>
</dependency>
<repository>
<id>mulesoft-releases1</id>
<name>MuleSoft Repository</name>
<url>http://repository-master.mulesoft.org/releases/</url>
<layout>default</layout>
</repository>
<repository>
<id>mulesoft-snapshots1</id>
<name>MuleSoft Snapshot Repository</name>
<url>http://repository-master.mulesoft.org/snapshots/</url>
<layout>default</layout>
</repository>
I had to change the id of the two new repositories, since my pom already had repositories of those id's.
Can anyone shed any light on this for me?
Do you have the EE maven credentials set settings.xml? I was able to build an empty application using mule-module-servicenow with the following auto-generated (by dragging the connector from Anypoint pallet onto canvas) repositories:
<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-snapshots</id>
<name>MuleSoft Snapshots Repository</name>
<url>http://repository.mulesoft.org/snapshots/</url>
<layout>default</layout>
</repository>
<repository>
<id>mule-ee-releases</id>
<name>MuleEE Releases Repository</name>
<url>https://repository-master.mulesoft.org/nexus/content/repositories/releases-ee/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>mulesoft-release</id>
<name>mulesoft release repository</name>
<layout>default</layout>
<url>http://repository.mulesoft.org/releases/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

How to configure Hudson to point to local repository instead of central one?

I'm a novice in Hudson and need it for automation in building the project. After installing Hudson-3.0.1, i tried building one of the projects manually. I keep getting this error.
ERROR: Failed to parse POMs
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM: Could not find artifact com.bnpparibas.parent:bnpparibas-parent:pom:1.0.1 in central (http://repo1.maven.org/maven2) and 'parent.relativePath' points at wrong local POM # line 41, column 10
I understand that it is looking for the artifact in the central repository rather than in my local. I don't know how to configure hudson to refer to local repository. All my google searches didn't yeild much useful information. Can somebody help me on this?
Redefine "central" repository in your pom:
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>http://localAddress[:localPort]/artifactory/libs-release</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://localAddress[:localPort]/artifactory/libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-release</name>
<url>http://localAddress[:localPort]/artifactory/plugins-release</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-snapshot</name>
<url>http://localAddress[:localPort]/artifactory/plugins-snapshot</url>
</pluginRepository>
</pluginRepositories>
Or add more repositories section to your pom
<repository>
<id>localRepo</id>
<name>libs-release</name>
<url>http://localAddress[:localPort]/artifactory/libs-release</url>
</repository>
Or if you have all artifacts in local repo (.m2/repository/) run compilation in off-line mode:
mvn -o clean install

Resources