Unable to get dependency in an internal repository - maven

We are using Maven 3.0.3. We have deployed a JAR file to an internal repository at
http://maven/maven_repo/repositories/release/org/openqa/selenium/server/selenium-server/0.9.2/selenium-server-0.9.2-standalone.jar
I have then included this dependency ...
<dependency>
<groupId>org.openqa.selenium.server</groupId>
<artifactId>selenium-server</artifactId>
<version>0.9.2</version>
<scope>test</scope>
</dependency>
Also, in my ~/.m2/settings.xml file, I have our internal repository ...
<repository>
<id>mycoInternalRelease</id>
<layout>default</layout>
<name>myco Internal Repository</name>
<url>http://maven/maven_repo/repositories/release</url>
<releases>
<enabled>true</enabled>
<checksumPolicy>fail</checksumPolicy>
<updatePolicy>always</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<checksumPolicy>fail</checksumPolicy>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
Despite all this, when I run my pom, I get the error
[ERROR] Failed to execute goal on project myco-productplus-web: Could not resolve dependencies for project myco-productplus:myco-productplus-web:war:1.0-SNAPSHOT:The following artifacts could not be resolved: org.openqa.selenium.server:selenium-server:jar:0.9.2, org.openqa.selenium.server:selenium-server-coreless:jar:0.9.2: Could not find artifact org.openqa.selenium.server:selenium-server:jar:0.9.2 in mycoInternalRelease (http://maven/maven_repo/repositories/release) -> [Help 1]
[ERROR]
How can I heal the pain? Thanks, - Dave

Given your artifact is named "selenium-server-0.9.2-standalone.jar" you might need to add <classifier>standalone</classifier> to your dependency declaration in your pom.

Related

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.

Could not find artifact org.wildfly:wildfly-parent:jar:10.0.0.Final. Where is it?

I'm trying to add server module dependencies for wildfly 10.0.0 Final in my pom but I can't find a a working repository.
I have this in my pom:
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-parent</artifactId>
<version>10.0.0.Final</version>
</dependency>
and I tried to add the jboss repository:
<repository>
<id>jboss-public-repository-group</id>
<name>JBoss Public Repository Group</name>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
and what I get is this:
Could not find artifact org.wildfly:wildfly-parent:jar:10.0.0.Final in jboss-public-repository-group (http://repository.jboss.org/nexus/content/groups/public/
I checked the repository. The pom is actually there but the jar at:
http://repository.jboss.org/nexus/content/groups/public/org/wildfly/wildfly-parent/10.0.0.Final/wildfly-parent-10.0.0.Final.jar
is not.
Which repository should I add?

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>

Maven ignores a repository

I'm unable to get Maven download an artifact
<dependency>
<groupId>org.jboss.test-jsf</groupId>
<artifactId>jsf-mock</artifactId>
<version>1.1.9</version>
<scope>test</scope>
</dependency>
This dependency isn't in the Maven Central. I've added the proper repository to my settings.
<profiles>
<profile>
<id>barbucha</id>
</profile>
<repositories>
<repository>
<id>jboss</id>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>jboss-plug</id>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</pluginRepository>
</pluginRepositories>
</profiles>
Then I build things using the barbucha profile. However maven doesn't use the JBoss repository at all. It tries to get the missing dependency from Central instead. It tries to download the dependency twice and then fails:
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/jboss/test-jsf/jsf-mock/1.1.9/jsf-mock-1.1.9.pom
[WARNING] The POM for org.jboss.test-jsf:jsf-mock:jar:1.1.9 is missing, no dependency information available
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/jboss/test-jsf/jsf-mock/1.1.9/jsf-mock-1.1.9.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project: Could not resolve dependencies for project: Could not find artifact org.jboss.test-jsf:jsf-mock:jar:1.1.9 in central (http://repo.maven.apache.org/maven2) -> [Help 1]
The behavior is very strange and sadly critical to me. I googled a long time, but nothing found, what can cause the problem. The only reason can be the profile if not activated. But that isn't my case.
Oh, it was so simple - my settings are just malformed:
<profiles>
<profile>
<id>barbucha</id>
</profile> <<< this must be at the end (at <!-- #1 --->)
<repositories>
... <!-- this part must be inside of profile -->
</pluginRepositories>
<!-- #1 --->
</profiles>
I apologize. (Hopefully it may help to someone.)

Maven: Warning if dependency if artefact is not found

Can I add option to Maven to say WARNING if some artefact wasn't found in some repository. Let's I have
<repositories>
<repository>
<id>main</id>
<name>main-repo</name>
<url>http://repourl</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
</repository>
</repositories>
But Maven not find some dependency of dependency in repo. Then he say WARNING in log. Can I do it?
A have in my company's repo resource 'org.apache.cxf:cxf-rt-frontend-jaxrs:pom:2.5.4'. But I havn't dependencies. This resource was copied to my JAR file. But no one dependency of 'cxf-rt-frontend-jaxrs' wasn't intsalled. In log
[INFO] Unable to find resource 'org.apache.cxf:cxf-rt-frontend-jaxrs:pom:2.5.4' in repository MAIN (http://url/)
Downloading: http://url//org/apache/cxf/cxf-rt-frontend-jaxrs/2.5.4/cxf-rt-frontend-jaxrs-2.5.4.pom
But no warning about dependencies of cxf-rt-frontend-jaxrs
Dependencies of cxf-rt-frontend-jaxrs are declared in org.apache.cxf:cxf-rt-frontend-jaxrs:pom:2.5.4 artifact, which Maven was not able to find. So, answer to your question is it can't be done.

Resources