How can i get sample .settings file? - mule

I need a .settings file, is there any common repository to access dependent jars ?
i need to access dependents for Mule projects,
Please assist.

Which .settings file are you referring to ? You mean settings.xml from maven to get access to MuleSoft repository and retrieve necessary dependencies ?
If this is the case... https://docs.mulesoft.com/mule-user-guide/v/3.8/configuring-maven-to-work-with-mule-esb
In that link you can find all the info you need to download Mule dependencies in your project.
Example:
<repositories>
<repository>
<id>mulesoft-releases</id>
<name>MuleSoft Repository</name>
<url>http://repository.mulesoft.org/releases/</url>
<layout>default</layout>
</repository>
<repository>
<id>mulesoft-snapshots</id>
<name>MuleSoft Snapshot Repository</name>
<url>http://repository.mulesoft.org/snapshots/</url>
<layout>default</layout>
</repository>
NOTE: for EE ( enterprise edition) dependencies you will need usename and password that must be provided by MuleSoft team, if you are not aware of your username and password, get in touch with your company or contact with Mulesoft

These are the common repositories which you need to include in your project
<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>

Related

how to port pentaho data integeration kettle plugins to apache hop?

In the document, I see change maven dependency but I cannot find the correct maven dependency for the hop, I mean they have mentioned Change group pentaho-kettle to org.hop
but I couldn't find any dependency for org.hop.
Can anyone say what exactly I need to do, or what exactly they are referring to?
can I use org.apache.hop is that the same??
Good catch, we'll update the documentation.
org.apache.hop is correct.
Hop doesn't publish artifacts to maven central (yet).
You can either build Hop locally or add the Apache repository to your pom:
<repository>
<id>Apache</id>
<url>https://repository.apache.org/snapshots/</url>
<name>Apache Repository</name>
<snapshots>
<enabled>true</enabled>
</snapshots>
<releases>
<enabled>false</enabled>
</releases>
</repository>

Intellij create sample struts web project with java,then show this error

Failed to download 'http://central.maven.org/maven2/org/apache/struts/struts2-core/2.5.14.1/struts2-core-2.5.14.1.jar':
central.maven.org
If you have URL to Maven Central Repository in your pom.xml defined like:
<repository>
<id>Maven Central</id>
<name>Maven Central Repository</name>
<url>http://central.maven.org/maven2</url>
</repository>
then url needs to be updated, to
<repository>
<id>Maven Central</id>
<name>Maven Central Repository</name>
<url>https://repo1.maven.org/maven2</url>
</repository>
because: "Beginning January 15, 2020, The Central Repository will no longer support communication over HTTP" (https://blog.sonatype.com/central-repository-moving-to-https)

EclipseLink Maven Repository not working correctly?

I'm trying to get the EclipseLink libraries from the given Maven repositories.
I read the tips given in Where did the EclipseLink/Maven repository go to? on stackoverflow and tried to integrate the Maven repositories posted there into my settings.xml.
I added those links to my settings.xml and also tried my pom.xml but when trying to update the indexes I only get
Resource nexus-maven-repository-index.properties does not exist
from all of them.
Here's what I've configured in my settings.xml
<repositories>
<repository>
<id>eclipseLink</id>
<name>eclipseLink</name>
<url>http://www.gtlib.gatech.edu/pub/eclipse/rt/eclipselink/maven.repo/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
<updatePolicy>always</updatePolicy>
</releases>
</repository>
<repository>
<id>EclipseLink Repo</id>
<name>eclipseLink</name>
<url>http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/rt/eclipselink/maven.repo</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
<updatePolicy>always</updatePolicy>
</releases>
</repository>
<repository>
<id>Eclipse 3</id>
<name>eclipseLink</name>
<url>http://eclipse.ialto.org/rt/eclipselink/maven.repo/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<checksumPolicy>warn</checksumPolicy>
<updatePolicy>always</updatePolicy>
</releases>
</repository>
</repositories>
I'm using the m2eclipse plugin for Eclipse to integrate the dependencies.
It seemed to me that in the Question mentioned above someone else is having the same issue in 2011, but it's not answered there.
Thanks for your help in advance.
I'm no maven, but I think the reason for this is that the repo is unindexed.
If you know what artifact you want, you can get it - but there's no index.

What repositories do you put in a generic pom file?

I am building a generic parent pom file for my projects.
In that file, I would like to have a list of most common Maven repositories, in order to have most dependencies available in the sub-projects (Jboss, Spring, etc.).
Here is this current pom:
<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.courtine</groupId>
<artifactId>parent</artifactId>
<packaging>pom</packaging>
<name>Parent</name>
<version>1.0</version>
<description>Common repositories</description>
<repositories>
<repository>
<id>javanet</id>
<name>Repository for Maven2</name>
<url>http://download.java.net/maven/2</url>
</repository>
<repository>
<id>google</id>
<name>Google repository for Maven2</name>
<url>https://oss.sonatype.org/content/repositories/google-releases/</url>
</repository>
<repository>
<id>jboss</id>
<name>JBoss repository for Maven2</name>
<url>http://repository.jboss.org/maven2/</url>
</repository>
<repository>
<id>com.springsource.repository.bundles.release</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
<url>http://repository.springsource.com/maven/bundles/release</url>
</repository>
<repository>
<id>com.springsource.repository.bundles.external</id>
<name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
<url>http://repository.springsource.com/maven/bundles/external</url>
</repository>
<repository>
<id>com.springsource.repository.libraries.release</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Library Releases</name>
<url>http://repository.springsource.com/maven/libraries/release</url>
</repository>
<repository>
<id>com.springsource.repository.libraries.external</id>
<name>SpringSource Enterprise Bundle Repository - External Library Releases</name>
<url>http://repository.springsource.com/maven/libraries/external</url>
</repository>
</repositories>
</project>
Is such a generic file listing common repositories a good idea?
Do you know other common public Maven repositories to put in such a generic pom file?
It is not a good idea to put repositories into a pom. Better use a Repository Manager like Nexus, Artifactory or Archiva.
In such kind of pom you should put things like default plugins with their appropriate revisions (pluginManagement) or dependencies which should be used (dependencyManagement).
Take a look for explanation into this. and take a look here how to setup this.
I have another option for doing what you want to do. You could using a profile in your settings.xml which reference all your repository for you (as an nexus/archiva will do).
I've posted something about his on my site.
Simply add this in your settings.xml:
<profile>
<id>my-repository</id>
<activation>
<!-- here we did not activat this profile by default -->
<activeByDefault>false</activeByDefault>
</activation>
<repositories>
<!-- list of standard repository -->
<repository>
<id>javanet</id>
<name>Repository for Maven2</name>
<url>http://download.java.net/maven/2</url>
</repository>
<repository>
<id>google</id>
<name>Google repository for Maven2</name>
<url>https://oss.sonatype.org/content/repositories/google-releases/</url>
</repository>
<repository>
<id>jboss</id>
<name>JBoss repository for Maven2</name>
<url>http://repository.jboss.org/maven2/</url>
</repository>
<repository>
<id>com.springsource.repository.bundles.release</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Bundle Releases</name>
<url>http://repository.springsource.com/maven/bundles/release</url>
</repository>
<repository>
<id>com.springsource.repository.bundles.external</id>
<name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
<url>http://repository.springsource.com/maven/bundles/external</url>
</repository>
<repository>
<id>com.springsource.repository.libraries.release</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Library Releases</name>
<url>http://repository.springsource.com/maven/libraries/release</url>
</repository>
<repository>
<id>com.springsource.repository.libraries.external</id>
<name>SpringSource Enterprise Bundle Repository - External Library Releases</name>
<url>http://repository.springsource.com/maven/libraries/external</url>
</repository>
<repository>
<id>intelligents-ia</id>
<name>Intelligents-ia Repository</name>
<url>http://intelligents-ia.com/maven2</url>
</repository>
</repositories>
</profile>
And you could build your project by adding -Pmy-repository on the command line:
mvn -Pmy-repository clean install
Or activate this profile by default by setting true on :
<activation>
<activeByDefault>true</activeByDefault>
</activation>

Maven build error - The following artifacts could not be resolved

I want to build a spring mvc project by maven, I got the following error:
The following artifacts could not be resolved: org.aopalliance:com.springsource.org.aopalliance:jar:1.0.0, org.hibernate:hibernate-validator:jar:4.2.0.Beta1: Could not find artifact org.aopalliance:com.springsource.org.aopalliance:jar:1.0.0 in central (http://repo1.maven.org/maven2)
I use eclipse and m2eclipse plugin. I don't know how to add local repository. And I found for different versions of eclipse,the result is different. Some can pass, some fail. I am confused.
By the way where can I find the version of maven used in m2eclipse?
Update:Now I can handle hibernate-validator,but even I deleted all spring mvc dependencies,I found there are many other library are dependent on com.springsource.org.aopalliance,
Check your %.m2\repository\org\aopalliance\com.springsource.org.aopalliance\1.0.0\.
If there isn't a com.springsource.org.aopalliance-1.0.0.jar in there, just download it by yourself and copy it to this folder.
Since you are working with spring artifacts, you can refer to this doc. If you are working on released versions of spring, you can add the following repository in your settings.xml
<repository>
<id>com.springsource.repository.maven.release</id>
<url>http://maven.springframework.org/release/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
[Edit 1: based on the comment]
The groupId/projectId of aopalliance seems to indicate it is in spring enterprise bundle repository. The contents of this accessible from the following repository url.
<url>http://repository.springsource.com/maven/bundles/release/</url>
As for hibernate-validator, being a beta release, it is possibly not available in the normal repos. It is available from
<url>http://repository.jboss.org/nexus/content/groups/public-jboss/</url>
The version of maven used in m2eclipse can be found in Window->Preferences->Maven->Installations
It looks like the artifact cann't be found in any repository you have defined in your settings.xml or pom file. Try adding sonatype repositories, they have artifacts you're looking for
In your pom.xml , add :
<project>
...
<repositories>
<repository>
<id>sonatype repo</id>
<url>https://repository.sonatype.org/content/repositories/central</url>
</repository>
</repositories>
...
</project>
However it's good practice to have its own repository manager (nexus, archiva, ...)
You should add the "external" repository to your pom.xml:
<repository>
<id>com.springsource.repository.bundles.external</id>
<url>http://repository.springsource.com/maven/bundles/external</url>
</repository>
My complete repositories tag in pom.xml is as follows:
<repositories>
<repository>
<id>com.springsource.repository.maven.release</id>
<url>http://repo.springsource.org/release/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>com.springsource.repository.bundles.release</id>
<url>http://repository.springsource.com/maven/bundles/release</url>
</repository>
<repository>
<id>com.springsource.repository.bundles.external</id>
<url>http://repository.springsource.com/maven/bundles/external</url>
</repository>
</repositories>