Order of maven repositories in settings.xml - maven

I have a settings.xml which looks like below:-
<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">
<servers>
<server>
<id>nReleases</id>
<username>test</username>
<password>test123</password>
</server>
<server>
<id>nSnapshots</id>
<username>test</username>
<password>test123</password>
</server>
</servers>
<profiles>
<profile>
<id>space</id>
<repositories>
<repository>
<id>central</id>
<url>http://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>nReleases</id>
<name>Releases</name>
<url>http://someserver/repository/maven-releases/</url>
</repository>
<repository>
<id>nSnapshots</id>
<name>Snapshots</name>
<url>http://someserver/repository/maven-snapshots/</url>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>space</activeProfile>
</activeProfiles>
</settings>
I want maven to check repo1.maven.org first and then only look in someserver. Can someone let me know how this can be achieved?
I am using Maven 3.3.9.
I have gone through this question and tried to change the order in which repos are declared in profile but it did not help.
<profile>
<id>space</id>
<repositories>
<repository>
<id>nReleases</id>
<name>Releases</name>
<url>http://someserver/repository/maven-releases/</url>
</repository>
<repository>
<id>nSnapshots</id>
<name>Snapshots</name>
<url>http://someserver/repository/maven-snapshots/</url>
</repository>
<repository>
<id>central</id>
<url>http://repo1.maven.org/maven2</url>
</repository>
</repositories>
</profile>
Logs while doing mvn clean install
tuk-MacBook-Pro-4:camel tuk$ mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building camel 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://someserver/repository/maven-releases/org/apache/camel/camel-redis/2.16.3/camel-redis-2.16.3.pom
Downloading: http://someserver/repository/maven-snapshots/org/apache/camel/camel-redis/2.16.3/camel-redis-2.16.3.pom

The order of the repository inside the settings was not clearly specified in Maven 2, but starting with Maven 3 (and the fix of of MNG-4400), the repositories are always tried in their declaration order in the settings.
What can happen, and what is likely the cause of your problem, is that Maven tries a repository, fails in doing so, and stores in your local repository the fact that it tried and failed. This results in the creation of .lastUpdated files in your local repository, storing this information. The consequence is that Maven will not re-try to download the dependency from a repository where it knows the download failed in the past. Thus, when you start a command and the project requires an artifact not present in your local repository, Maven will still try the repositories in their order of declaration, but it will skip the ones it knows already failed.
But you can force it to bypass this mechanism by passing the -U flag on the command line. It forces Maven to update the releases and snapshots dependencies, without looking into .lastUpdated files. This way, it will re-try every active remote repositories.

Related

How to see what Maven is sending to a server during deploy?

I'm trying to use Github's new Actions CI server to deploy packages to Github's new packages feature. It's not going well.
I think it's all set up correctly, but I get this error:
Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy
(default-deploy) on project myproject: Failed to deploy artifacts: Could not
find artifact com.mycompany:myproject:pom:1.5 in github
(https://maven.pkg.github.com/mycompany/mycompany_repository) -> [Help 1]
This happens after it appears to upload that same pom successfully:
Uploading to github: https://maven.pkg.github.com/mycompany/mycompany_repository
/com/mycompany/myproject/1.5/myproject-1.5.pom
Progress (1): myproject-1.5.pom (4.1/6.1 kB)
Progress (1): myproject-1.5.pom (6.1 kB)
So, it looks to me like it is successfully uploading the pom, but then it fails to download the same pom a few seconds later.
I'm running the deploy with debug switches on: mvn -X -e deploy, but I can't see the exact http commands that Maven is sending to the server.
How do I debug this? Is there some Maven/Aether transport or something that will log what is going on under the covers?
In case anyone else lands here looking for a solution to OPs issue publishing to github, I had a similar issue and found that the URLs needed in settings.xml and pom.xml are inconsistent. In your settings.xml, the repo URL needs to be of the form https://maven.pkg.github.com/myuser/com/mycompany/mypackage, whereas in your project's pom file, it needs to be of the form https://maven.pkg.github.com/myuser/mypackage. So, for example, your settings.xml file in ~/.m2 would look something like this:
<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">
<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>false</enabled></snapshots>
</repository>
<repository>
<id>github</id>
<name>GitHub Apache Maven Packages</name>
<url>https://maven.pkg.github.com/myuser/com/mycompany/mypackage</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>false</enabled></snapshots>
</repository>
</repositories>
</profile>
</profiles>
<servers>
<server>
<id>github</id>
<username>myuser</username>
<password>mypersonalaccesstoken</password>
</server>
</servers>
</settings>
Whereas the pom.xml file in the root of your project would need to look like this:
<project>
...
<groupId>org.mycompany</groupId>
<artifactId>mypackage</artifactId>
<version>1.0.0</version>
...
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Apache Maven Packages</name>
<url>https://maven.pkg.github.com/myuser/mypackage</url>
</repository>
</distributionManagement>
...
</project>
Other than this minor (but crucial) detail, my steps were the same as those outlined here. This allowed me to publish my Maven package to github package registry.
You can enable debug logging in the workflows.
Just add the secret:
ACTIONS_RUNNER_DEBUG
And set to true
See a similar answer here
I just spend 3 hours debugging why the guide on the page did not work for me. If you are following the guide posted here 1.
OWNER is your github username, and REPOSITORY is - you guessed it, the repo name.
Just remember to use lowercase in both OWNER and REPOSITORY.
When generating the personal access token, make sure the scopes for the token are the repo:* scopes as well as the more obvious write:packages and read:packages scopes (do not disable the repo scopes)
Otherwise it does just that
The following solution works for me:
Create a repository for packages e.g. maven-packages
Add <server></server> settings under <servers> in settings.xml: (do this per id used below)
<server>
<id>github</id>
<username>YOUR GITHUB USERNAME</username>
<password>A GITHUB TOKEN YOU CREATE FOR PUBLISHING PACKAGES</password>
</server>
Do NOT add <activeProfiles>, <profile> or <repositories> to settings.xml (only add <server> elements) as this is redundant for publishing and I am adding them to consuming projects' maven.xml so no need for duplication.
Add repository/ies to distributionManagement in pom.xml as follows:
<distributionManagement>
<snapshotRepository>
<id>github-snapshot</id>
<name>GitHub snapshot</name>
<url>https://maven.pkg.github.com/OWNER/maven-packages/</url>
<uniqueVersion>true</uniqueVersion>
</snapshotRepository>
<repository>
<id>github-release</id>
<name>GitHub release</name>
<url>https://maven.pkg.github.com/OWNER/maven-packages/</url>
<uniqueVersion>false</uniqueVersion>
</repository>
</distributionManagement>
Where OWNER is the GitHub account your project is / projects are under and maven-packages is the repositories you want to publish you project(s) to.
This enables using a dedicated repository for listing packages instead of publishing each project's package to a different (its own) repository, making consumption of multiple packages from your GitHub account easier, as you only need to configure a single repository for these packages:
<repositories>
<repository>
<id>github</id>
<name>GitHub</name>
<url>https://maven.pkg.github.com/OWNER/maven-packages/</url>
</repository>
</repositories>
Note: in the <servers> section of your settings.xml define a <server> per id used in repositories and distributionManagement e.g. github-snapshot, github-release, github in the above examples.

Is there such a thing as a local remote Maven repository?

I have a build box on which is installed:
Maven
Bamboo
Archiva
I have configured Bamboo to grab my Maven project from a remote Git source and then build it with the goals 'clean install'.
I have configured Archiva with two repos:
mirror - a mirror of central
dev - repo for my artifacts
I have made the following changes to Maven settings.xml:
# Define local repo - this is the same location as i have set up for the Archiva 'dev' repo.
<localRepository>/opt/maven-repo/dev</localRepository>
# Define the Archiva mirror i set up
<mirror>
<id>mirror</id>
<url>http://localhost:8080/repository/mirror/</url>
<mirrorOf>external:*</mirrorOf>
</mirror>
When I execute the build Maven grabs everything external via the mirror and then adds the built artifact to dev, along with the other jars it grabbed from mirror. So i now have some duplicate jars...
\repo\mirror\junit\junit
\repo\mirror\classworlds\classworlds
\repo\dev\junit\junit
\repo\dev\classworlds\classworlds
\repo\dev\me\myartifact
My question is, is the correct approach? Really I want to keep 'dev' with just my artifacts and mirror with everything from central - i don't want duplicates.
Should I be using the LocalRepository config in settings.xml or should I be using 'mvn deploy' to put the artifact in my Archiva repository by a different method?
Could someone clarify the different use cases for a local and remote repository?
Finally, how should I be defining my POM? Currently, I have just defined
<distributionManagement>
<repository>
<id>dev</id>
<url>file:///repo/dev</url>
</repository>
</distributionManagement>
Should i be adding in my mirror?
To put artifacts in your repository manager you should use the default which is maven-deploy-plugin which can be controlled by distributionManagement. The target where to put those things is controlled by defining the distributionManagement.
<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">
...
<distributionManagement>
<repository>
<id>releases</id>
<name>Release</name>
<url>http://urlArchiva/releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>Snapshots</name>
<url>http://urlArchiva/snapshots/</url>
</snapshotRepository>
...
</distributionManagement>
...
</project>
The repositories which are used to consume artifacts from is defined in the settings.xml
<settings>
<mirrors>
<mirror>
<!--This sends everything else to /public -->
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://serverUrlArchiva/public/</url>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>central</id>
<url>http://central</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<!--make the profile active all the time -->
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
On Bamboo you should be able to control which settings.xml is used to have an local repository per build which makes build independent from each other.

Why Artifactory Maven and Oracle fail to communicate?

I hope an answer will be a universal guide on how to connect Maven, Oracle And Artifactory and will become most usefull webpage on the net. Most likely this question will be marked down, but I just give up on Maven, Artifactory and Oracle.
I am running windows 7-64 with maven installed as a part of Oracle jdev. Company has Artifactory setted up and running on vpn network.... but somethings are not right.
Following simple instructions on:
http://biemond.blogspot.co.uk/2013/07/maven-support-in-weblogic-jdeveloper.html
fails at first instruction:
Install the oracle maven sync plugin to your local repository
the command:
mvn deploy:deploy-file -DpomFile=oracle-maven-sync.12.1.2.pom -Dfile=oracle-maven-sync.12.1.2.jar
the error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli) on project standalone-pom: The parameters 'url' for goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file are missing or invalid -> [Help 1]
adding
-Durl=file://C:\Users\{user}\.m2
seems to install that artifact to my local .m2 repo
C:\Users\{user}\.m2\com\oracle\maven\oracle-maven-sync\12.1.2-0-0
but only seems, then I get to number 3 on that tutorial:
mvn com.oracle.maven:oracle-maven-sync:help
gives an error:
[ERROR] Error resolving version for plugin 'com.oracle.maven:oracle-maven-sync' from the repositories [local (C:\Users\{user}\.m2), central (http://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository -> [Help 1]
So the plugin failed to install?
Oracle Maven repository is password protected due to weird oracle thoughts, Artifactory has external Central and Oracle repositories why letting it mirror everything stops maven from even finding deploy module?
here is my settings.xml:
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<username>user</username>
<password>xxx</password>
<id>central</id>
</server>
<server>
<username>user</username>
<password>xxx</password>
<id>snapshots</id>
</server>
</servers>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release-local</name>
<url>http://art.host.ru:8081/artifactory/libs-release-local</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>libs-snapshot-local</name>
<url>http://art.host.ru:8081/artifactory/libs-snapshot-local</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-release-local</name>
<url>http://art.host.ru:8081/artifactory/plugins-release-local</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-snapshot-local</name>
<url>http://art.host.ru:8081/artifactory/plugins-snapshot-local</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
<profile>
<id>oracle-maven</id>
<properties>
<oracle-maven-sync.oracleHome>C:\Oracle\Middleware\Oracle_Home</oracle-maven-sync.oracleHome>
<oracle-maven-sync.testOnly>false</oracle-maven-sync.testOnly>
<oracle-maven-sync.failOnError>false</oracle-maven-sync.failOnError>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>oracle-maven</activeProfile>
</activeProfiles>
</settings>
Well, I think you just follow the wrong guide. All this manual deployment of some random maven plugins is just wrong.
Just follow the simple and detailed instructions in the Artifactory User Guide and you're good to go.
The problem is with the -Dmaven.repo.local
Do not provide the argument.
Use http://jcenter.bintray.com for most of the artifacts
And for Oracle: oracle-maven-sync plugin
oracle instructions
$ORACLE_HOME = where jdev 12.1.2
$M2_HOME = $ORACLE_HOME/oracle_common/modules/org.apache.maven_3.0.4
$M2 = $M2_HOME/bin (add to $PATH)
artifactory->home->maven settings generate settings.xml put it in ~/.m2
create local repo in artifactory"oracle-local-12.1.2"
settings.xml add following code
<profiles>
<profile>
<properties>
<oracle-maven-sync.oracleHome>$ORACLE_HOME</oracle-maven-sync.oracleHome>
<oracle-maven-sync.testOnly>false</oracle-maven-sync.testOnly>
<oracle-maven-sync.failOnError>false</oracle-maven-sync.failOnError>
<oracle-maven-sync.serverId>oracle-local-12.1.2</oracle-maven-sync.serverId></properties>
artifactory -> username(top right corner) -> enter pass -> unlock -> забрать encrypted password(copy)
add aquired pass to settings.xml for all
go to $ORACLE_HOME/oracle_common/plugins/maven/com/oracle/maven/oracle-maven-sync/12.1.2 (use cmd/terminal)
mvn deploy:deploy-file -DpomFile=oracle-maven-sync-12.1.2.pom -Dfile=oracle-maven-sync-12.1.2.jar
test it: mvn com.oracle.maven:oracle-maven-sync:help
push artifacts oracle 12.1.2 mvn com.oracle.maven:oracle-maven-sync:push
long time wait (~3000 artifacts > 2 hours)
complete set up of repos and in settings.xml

How do you configure maven to ignore repositories specified in POM files?

I have a project on a company intranet (read - no outside internet access). I have a server running Artifactory with all required maven artifacts. I have a settings.xml file pointing maven to the running Artifactory server. Everything is happy and maven can download dependencies until an artifact specifying a repository in the POM file (in my case org/eclipse/jetty/jetty-project/7.5.4.v20111024/jetty-project-7.5.4.v20111024.pom). Then maven attempts to load the remaining dependencies from the repo specified in the POM file instead of from Artifactory. This breaks the build. How do you configure maven to ignore repositories specified in POM files?
Thanks,
Nathan
As a workaround, define another repository in your settings.xml with the same ID (is it oss.sonatype.org, defined in jetty-parent:19, that's the problem?) and point it at your repo. Maven will use that definition in favour of the one in the pom.
There's an open issue filed against Maven (MNG-3056) to allow this to be configured so only your repo would be used; in general, if you have a local repository, that would be the behaviour you would want.
That's a great answer Joe. Thank you. I was looking for it for quite some time.
I just quote an example, in which I had the same problem as Nathan.
I use a Maven enterprise repository (Nexus or Artifactory) and I am behind a proxy, that means that I cannot download directly (and do not want to) from any other repositories than mine.
Jasper reports net.sf.jasperreports:jasperreports:6.2.0 defines in its pom a couple of repositories.
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>6.2.0</version>
...
<repositories>
<repository>
<id>jasperreports</id>
<url>http://jasperreports.sourceforge.net/maven2</url>
</repository>
<repository>
<id>jaspersoft-third-party</id>
<url>http://jaspersoft.artifactoryonline.com/jaspersoft/third-party-ce-artifacts/</url>
</repository>
</repositories>
This causes the following exception:
C:\my-project>mvn verify
[INFO] Scanning for projects...
[INFO] Building my-project 1.0.0-SNAPSHOT
[INFO]
Downloading: http://mynexus/nexus/content/groups/ch-public/com/lowagie/itext/2.1.7.js4/itext-2.1.7.js4.pom
Downloading: http://jasperreports.sourceforge.net/maven2/com/lowagie/itext/2.1.7.js4/itext-2.1.7.js4.pom
Downloading: http://jaspersoft.artifactoryonline.com/jaspersoft/third-party-ce-artifacts/com/lowagie/itext/2.1.7.js4/itext-2.1.7.js4.pom
[INFO] BUILD FAILURE
[INFO] Could not resolve dependencies for project ... :
Failed to collect dependencies at net.sf.jasperreports:jasperreports:jar:6.2.0 ->
com.lowagie:itext:jar:2.1.7.js4: Failed to read artifact descriptor for com.lowagie:itext:jar:2.1.7.js4:
Could not transfer artifact com.lowagie:itext:pom:2.1.7.js4
from/to jasperreports (http://jasperreports.sourceforge.net/maven2):
Connect to jasperreports.sourceforge.net:80 [jasperreports.sourceforge.net/216.34.181.96]
failed: Connection timed out:
The solution as described by Joe is:
In global settings.xml (C:/maven-installation/conf/settings.xml) or private settings.xml (~/.m2/settings.xml) add the following profile:
<profiles>
<profile>
<id>ignore-repositories</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<repositories>
<repository>
<id>jasperreports</id>
<url>http://mynexus/nexus/content/groups/ch-public/
</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<repository>
<id>jaspersoft-third-party</id>
<url>http://mynexus/nexus/content/groups/ch-public/
</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
Important: the repository id in the profiles (jasperreports , jaspersoft-third-party) matches exactly the id of the repository used in pom.xml - in this case the pom.xml of net.sf.jasperreports:jasperreports:6.2.0
Do not forget to add the "external" repositories to the "proxy" list of your Maven Enterprise Repository

Dependency resolution configuration in Artifactory

Recently we started to work with Artifactory. We configured settings.xml as Artifactory proposed. However we have problems downloading jars while running "mvn compile", even if they appear in Artifactory repo. Adding explicitly repo1-cache solves the compilation problem but download is performed from remote repository rather than from Artifactory.
<repository>
<id>My Repository</id>
<name>MyRepository-releases</name>
<url>http://mvn-srv:8081/artifactory/repo1</url>
</repository>
What should be added to settings.xml in for resolving automatically dependencies and fetching them from artifactory rather than accessing remote servers each time?
settings.xml:
<?xml version="1.0" encoding="UTF-8"?>
<settings
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"
xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>libs-release</name>
<url>http://mvn-srv:8081/artifactory/libs-release</url>
</repository>
<repository>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>snapshots</id>
<name>libs-snapshot</name>
<url>http://mvn-srv:8081/artifactory/libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>plugins-release</name>
<url>http://mvn-srv:8081/artifactory/plugins-release</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>plugins-snapshot</name>
<url>http://mvn-srv:8081/artifactory/plugins-snapshot</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
<servers>
<server>
<id>MyRepository</id>
</server>
</servers>
Compilation error:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.355s
[INFO] Finished at: Wed Nov 14 14:52:31 IST 2012
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project common: Could not resolve dependencies for project com.myc
ompany.app:common:jar:1.0-SNAPSHOT: The following artifacts could not be resolved: commons-jxpath:co
mmons-jxpath:jar:1.3-osgi, xpp3:xpp3_min:jar:1.1.3.4.O-osgi, net.java.dev.stax-utils:stax-utils:jar:
20080702-osgi, net.sf.saxon:saxon:jar:8.9.0.4-osgi, net.sf.saxon:saxon-dom:jar:8.9.0.4-osgi, net.sf.
saxon:saxon-xqj:jar:8.9.0.4, dom4j:dom4j:jar:1.6.1-osgi, mx4j:mx4j-jmx:jar:2.1.1-osgi, mx4j:mx4j-imp
l:jar:2.1.1-osgi, mx4j:mx4j-tools:jar:2.1.1-osgi, mx4j:mx4j-remote:jar:2.1.1-osgi, com.yourkit:yjp-c
ontroller-api-redist:jar:9.0.8, org.apache.geronimo.specs:geronimo-jms_1.1_spec:jar:1.1-osgi, common
s-codec:commons-codec:jar:1.3-osgi, commons-httpclient:commons-httpclient:jar:3.1-osgi, quartz:quart
z-all:jar:1.6.6: Could not find artifact commons-jxpath:commons-jxpath:jar:1.3-osgi in central (http
://mvn-srv:8081/artifactory/libs-release) -> [Help 1]
Adding to #duncan-jones excellent answer, great way to troubleshoot resolution is performing Trace Artifact Retrieval call, in your case:
http://mvn-srv:8081/artifactory/libs-release/commons-jxpath/commons-jxpath/1.3-osgi/commons-jxpath-1.3-osgi.jar?trace
BTW, I don't even see the 1.3-osgi version in repo1.
You need to ensure your virtual repositories map to the real repositories you expect.
For example, libs-release will typically map to both internal and external release repositories. Perhaps this is mis-configured, resulting in it not hitting the repositories you want.
In Artifactory, go to the Admin page and look at Configuration > Repositories. At the bottom of the page, take a look at your virtual repositories. Double-clicking on them will show you what is included.
For me, libs-release includes libs-release-local, ext-release-local and remote-repos. The latter is another virtual repository that maps to all the external repositories listed in my installation, e.g. codehaus, repo1, jboss, google-code, ...
Perhaps one of these virtual repositories is missing repo1?

Resources