I am using maven 3.x.x and trying to use versions ranges in my pom.xml and it never worked. I tried version-ordering suggested by maven and getting the order as expected on my terminal. But when running maven compile, always getting error as below
Failed to execute goal on project test-client: Could not resolve dependencies for project com.abc.def:test-client:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at development.com.abc.test:my-service:jar:jar:[1.0.211006-mr424,1.0.211014-mr427]: No versions available for development.com.abc.test:my-service:jar:jar:[1.0.211006-mr424,1.0.211014-mr427] within specified range -> [Help 1]
But if I use the fixed version in my pom.xml, things start working.
my pom.xml:
<dependency>
<groupId>development.com.abc.test</groupId>
<artifactId>my-service</artifactId>
<version>[1.0.211006-mr424, 1.0.211014-mr427]</version>
<classifier>jar</classifier>
</dependency>
PS : the artifact uploaded for my-service does not contain maven-metadata.xml in the repository.
The end goal I am trying to achieve is to resolve dynamic dependencies
Related
I am trying to build a mule app with Maven using Mule Server 3.7.0 EE.
I'm erroring out when trying to add to my app the Data-weave Transformer.
I added to my pom.xml file this dependency:
<dependency>
<groupId>com.mulesoft.weave</groupId>
<artifactId>mule-plugin-weave_2.11</artifactId>
<version>${mule.version}</version>
<scope>provided</scope>
</dependency>
but I am getting this error:
[ERROR] Failed to execute goal on project project370: Could not resolve dependencies for project com.test:project370:mule:1.0.0-SNAPSHOT: Failure to find com.mulesoft.weave:mule-plugin-weave_2.11:jar:3.7.0 in http://repo1.maven.org/maven2/ was cached in the local repository, resolution will not be reattempted until the update interval of Central has elapsed or updates are forced -> [Help 1]
Any ideas how to fix?
try doing mvn install -U where -U would force your maven dependencies to be updated.
If you are using the maven m2 plugin for eclipse you can right click on your project Maven -> Update Project make sure that "Force Update of Snapshots/Releases" is enabled then click OK.
Also check this link for the documentation on configuring your repository properly.
I use maven to manage my jar files in my project.Firstly ,I download the org.apache.mrunit of version 0.8.0-incubating.But I find that it is not compatiable with my project so I remove it and what to re-download a 1.0.0 version.But I cannot download the version 1.0.0. Error message in eclipse is:
[ERROR] Failed to execute goal on project MapReducer: Could not
resolve dependencies for project
org.MapReducer1.0.0:MapReducer:jar:0.0.1-SNAPSHOT: Failure to find
org.apache.mrunit:mrunit:jar:1.0.0 in
http://repo.maven.apache.org/maven2 was cached in the local
repository, resolution will not be reattempted until the update
interval of central has elapsed or updates are forced -> [Help 1]
But when I search mrunit online ,I can get the version list:
But when I search it in my pom.xml of eclipse , I can only get the version 0.8.0-incubating:
Anyone can help me?
I know this is a rather old question, but I just encountered the same problem. I resolved it by adding a classifier, as indicated on the Apache MRUnit Tutorial page
<dependency>
<groupId>org.apache.mrunit</groupId>
<artifactId>mrunit</artifactId>
<version>1.1.0</version>
<classifier>hadoop2</classifier>
</dependency>
User hadoop1 if you are using an older version of hadoop.
I'm attempting to use the Grails Maven plugin to build a war file. There's a known problem with the plugin in that it does not resolve range dependencies, and my project pom file must contain range dependencies.
The dependency is specified like this:
<dependency>
<groupId>mygroup</groupId>
<artifactId>myartifact</artifactId>
<version>[0.0.0,999.999.999)</version>
</dependency>
The error message is like this:
[ERROR] Failed to execute goal
org.grails:grails-maven-plugin:2.2.1:clean (default-clean) on project
sdm: Failed to create classpath for Grails execution. Encountered
problems resolving dependencies of the executable in preparation for
its execution. Error resolving project artifact: Could not transfer
artifact mygroup.myartifact:pom:[0.0.0,999.999.999) from/to myRepo
(https://maven.mydomain/nexus/content/groups/myRepo):
IllegalArgumentException for project
mygroup.myartifact:pom:[0.0.0,999.999.999): Illegal character in path
at index 89:
https://maven.mydomain/nexus/content/groups/myRepo/mygroup/myartifact/[0.0.0,999.999.999)/myartifact-[0.0.0,999.999.999).pom
-> [Help 1]
As you can see, the range dependency is not being resolved, and a literal version "[0.0.0,999.999.999)" is being looked for.
To work around the problem, I can use the Maven version plugin and do this:
mvn versions:resolve-ranges [replaces range deps in pom file with actual versions]
mvn grails:war [builds war based on actual versions in newly modified pom file]
mvn versions:revert [reverts pom file to original state]
BUT here's my problem: if I combine these goals into one Maven command:
mvn versions:resolve-ranges grails:war versions:revert
the grails:war fails with the error I described above - it seems to be seeing the pom file in its initial state (with the range dependencies), even though the versions plugin has updated the pom file with actual version numbers. After the failure, the pom file has this:
<dependency>
<groupId>mygroup</groupId>
<artifactId>myartifact</artifactId>
<version>2.1.15</version>
</dependency>
So my question is - why does the second goal (grails:war) see the pom file as it was at the start of the whole chain of goals, not as it is when the goal runs? How can I make the second goal (grails:war) see the pom file as it stands after completion of the first goal (versions:resolve-ranges)?
I have a Maven project that so far used to compile without problems. Today, when I run mvn clean package -U, I get:
[ERROR] Failed to execute goal on project myproj: Could not resolve dependencies for project org.myorg.myproj:myproj:jar:1.0-SNAPSHOT: The following artifacts could not be resolved: javax.servlet:javax.servlet-api:src:sources:3.0.1, org.eclipse.jetty:jetty-servlet:src:sources:8.1.2.v20120308, org.eclipse.jetty:jetty-server:src:sources:8.1.2.v20120308, org.eclipse.jetty:jetty-webapp:src:sources:8.1.2.v20120308, commons-io:commons-io:src:sources:2.4: Could not find artifact javax.servlet:javax.servlet-api:src:sources:3.0.1 in MyRepo (http://maven.myorg.org:9001/nexus/content/repositories/myrepo/) -> [Help 1]
I tried to with a fresh local Maven repository (rm -fr ~/.m2/repository) but that did not make any difference.
Why does Maven try to find source/src artefacts? Any ideas where the problem might lie?
Edit: My dependencies (as seen using mvn help:effective-pom) do not have any source classifiers. For example, the dependency on the jetty-server mentioned in the error message reads as follows:
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>8.1.2.v20120308</version>
<scope>compile</scope>
</dependency>
Solution: With the help of #AlessandroSantini and #brian-topping, I finally identified the problem. One of my indirect dependencies had a <classifier>sources</classifier> and <type>src</type>. (mvn help:effective-pom did not show these indirect dependencies, and mvn dependency:tree failed with the above error message, too; eventually, a grep -r 'jetty-server' ~/.m2/repository/ -C 3 identified the artifact with the messed up dependency.)
It turned out that one of my own SBT projects required the (non-existing) source artifacts for one of its dependencies: I used SBT's withSources() where I should have used sbteclipe's EclipseKeys.withSource := true to get the sources in Eclipse.
Do you have any dependencies on public snapshots? I'd take a look at the output of mvn dependency:tree and see if you can find a transitive dependency that is including the sources somehow. Maybe one of the transitives have changed since your last build and they messed something up.
I'm using Maven 3.0.3. I want to use the Selenium Maven plugin's selenese goal to run some Selenium tests, but I can't find the necessary selenium-server JAR. I have this in my pom.xml ...
<dependency>
<groupId>org.openqa.selenium.server</groupId>
<artifactId>selenium-server</artifactId>
<version>0.9.2</version>
</dependency>
but when I run my build I get the error
[ERROR] Failed to execute goal on project cme-productplus-web2: Could not resolve dependencies for project cme-productplus2:cme-productplus-web2:war:1.0-SNAPSHOT: Could not find artifact org.openqa.selenium.server:selenium-server:jar:0.9.2in central (http://repo1.maven.org/maven2) -> [Help 1]
Where do I get this mysterious JAR file or what repository do I need to add to find it?
Thanks, - Dave
It is not available from any Maven repo.
you have to download it (http://release.seleniumhq.org/selenium-remote-control/0.9.2/), and add it manually in your local repository (http://maven.apache.org/plugins/maven-install-plugin/examples/specific-local-repo.html).