Maven dependency is downloading only pom not jar for newer version - java

I have a dependency on JBoss's teiid framwork. If I add the dependency on older version it downloads the jar file while if I add dependency on newer version it only downloads pom file. below is my pom config
repository:
<repository>
<id>jboss-public-repository-group</id>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
This will download jar
<dependency>
<groupId>org.jboss.teiid</groupId>
<artifactId>teiid-client</artifactId>
<version>8.5.0.Final</version>
</dependency>
This will download only pom file
<dependency>
<groupId>org.jboss.teiid</groupId>
<artifactId>teiid-client</artifactId>
<version>8.9.1</version>
</dependency>
Update:
Maven log
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building hello-teiid 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: http://repository.jboss.org/nexus/content/groups/public/org/jboss/teiid/teiid-client/8.9.1/teiid-client-8.9.1.pom
[INFO] Downloaded: http://repository.jboss.org/nexus/content/groups/public/org/jboss/teiid/teiid-client/8.9.1/teiid-client-8.9.1.pom (2 KB at 1.4 KB/sec)
[INFO] Downloading: http://repository.jboss.org/nexus/content/groups/public/org/jboss/as/jboss-as-parent/7.4.0.Final-redhat-4/jboss-as-parent-7.4.0.Final-redhat-4.pom
[INFO] Downloading: http://repo.maven.apache.org/maven2/org/jboss/as/jboss-as-parent/7.4.0.Final-redhat-4/jboss-as-parent-7.4.0.Final-redhat-4.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.047 s
[INFO] Finished at: 2015-01-28T09:41:17-05:00
[INFO] Final Memory: 6M/123M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project hello-teiid: Could not resolve dependencies for project hello:hello-teiid:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at org.jboss.teiid:teiid-client:jar:8.9.1: Failed to read artifact descriptor for org.jboss.teiid:teiid-client:jar:8.9.1: Could not find artifact org.jboss.as:jboss-as-parent:pom:7.4.0.Final-redhat-4 in jboss-public-repository-group (http://repository.jboss.org/nexus/content/groups/public/) -> [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

If you search for this artifact in the jboss repo, you can see that in version 8.9.1 its packaging is "bundle", while in version 8.5.0 it was defaulted to "jar".
Now that we have noticed this, we can relate to the comment of #AlexandrM, OSGI Bundle vs jar dependency,
or to be even more specific, Why can't maven find an osgi bundle dependency? (note the 2nd answer, not the accepted one. Basically, you need to add a plugin that defines it, namely the maven-bundle-plugin).

Related

Jersey-server Maven - Could not resolve dependencies for project

It looks like the Jersey server has moved to glassfish, but I changed to use correct GAV values and yet I am not having any luck! A simple Jersey helloworld REST project wont build ! Here is my maven dependencies relevant to Jersey
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<version>2.25</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<version>2.25</version>
</dependency>
Here is the error I am getting:
[INFO] Scanning for projects...
[INFO]
[INFO] ---------------------< com.xxxxxxx >----------------------
[INFO] Building xxxxxxx Server 0.0.1-SNAPSHOT
[INFO] --------------------------------[ war ]---------------------------------
Downloading from central: http://repo1.maven.org/maven2/org/glassfish/jersey/containers/jersey-container-servlet/2.25/jersey-container-servlet-2.25.pom
Downloading from central: http://repo1.maven.org/maven2/org/glassfish/jersey/core/jersey-server/2.25/jersey-server-2.25.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.197 s
[INFO] Finished at: 2020-12-25T13:41:38-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project restserver: Could not resolve dependencies for project com.xxxxxxx:restserver:war:0.0.1-SNAPSHOT: Failed to collect dependencies at org.glassfish.jersey.co
ntainers:jersey-container-servlet:jar:2.25: Failed to read artifact descriptor for org.glassfish.jersey.containers:jersey-container-servlet:jar:2.25: Could not transfer artifact org.glassfish.jersey.containers:jersey-container-servlet:pom:2.25 from/to central (http://repo1.maven.org/maven2): Failed to transfer file http://repo1.maven.org/maven2/org/glassfish/jersey/containers/jersey-container-serv
let/2.25/jersey-container-servlet-2.25.pom with status code 501 -> [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 am going to answer my own question, just so this helps someone and it is easily noticeable.
This has to be the smallest answer - append 's' to http in settings.xml. Not sure how my other projects were building.
Just out of curiosity, after a successful build, I removed the 's' and rebuilt the project without any changes and it starts to pass. It may have cached the binaries in my local repo... and then eventually started failing after a while, so put it back!

Vaadin no plugin found for prefix jetty

Good evening, im trying to install vaadin framework and integrate it into my eclipse but everytime i try to run the maven build i keep getting this error block, the main part is that the prefix jetty is not recognized and im not sre how to deal with that. Please help
[INFO] Scanning for projects...
[WARNING] The project com.gmail.khaled:my-starter-project:pom:1.0-SNAPSHOT uses prerequisites which is only intended for maven-plugin projects but not for non maven-plugin projects. For such purposes you should use the maven-enforcer-plugin. See https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] My Starter Project [pom]
[INFO] My Starter Project-backend [jar]
[INFO] My Starter Project-ui [war]
[INFO] Downloading from : https://maven.vaadin.com/vaadin-prereleases/org/codehaus/mojo/maven-metadata.xml
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
[INFO] Downloading from : https://maven.vaadin.com/vaadin-prereleases/org/apache/maven/plugins/maven-metadata.xml
[INFO] Downloading from : https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml (14 kB at 13 kB/s)
[INFO] Downloaded from : https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml (20 kB at 18 kB/s)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] My Starter Project 1.0-SNAPSHOT .................... SKIPPED
[INFO] My Starter Project-backend ......................... SKIPPED
[INFO] My Starter Project-ui 1.0-SNAPSHOT ................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.739 s
[INFO] Finished at: 2019-03-18T21:39:18+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'jetty' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\hp\.m2\repository), vaadin-prereleases (https://maven.vaadin.com/vaadin-prereleases), central (https://repo.maven.apache.org/maven2)] -> [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/NoPluginFoundForPrefixException
This error message tells, that there is no maven Jetty plugin defined in the pom.xml where you are trying to run jetty:run target. Hence it is failing. Usually the convention in multi module maven projects is to place Jetty plugin to actual application module. In your case it is probably the "My Starter Project-ui" module. If it is not there you need to add it there.
I had the same problem. When creating a debug configuration in the field goal
do not type: jetty:run
instead type: spring-boot:run

The POM for org.sonarsource.sonarqube:sonar-check-api:jar:7.0-SNAPSHOT is missing, no dependency information available

I am a fresh in Sonar.When I try to use this example to write custom rules,the dependency "sonar-plugin-api" I see is version 6.7. But my Sonar's version is 7.0. I don't know what's the matter with the difference. So I download the SonarSource 7.0 to get the jar. But I get the following errors when I build the Maven project "sonar-plugin-api".
[INFO] os.detected.name: windows
[INFO] os.detected.arch: x86_64
[INFO] os.detected.version: 10.0
[INFO] os.detected.version.major: 10
[INFO] os.detected.version.minor: 0
[INFO] os.detected.classifier: windows-x86_64
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] --------------------------------------------------------------------- ---
[INFO] Building SonarQube :: Plugin API 7.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.sonarsource.sonarqube:sonar-check-api:jar:7.0- SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.sonarsource.sonarqube:sonar-duplications:jar:7.0-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.sonarsource.sonarqube:sonar-testing-harness:jar:7.0-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.468 s
[INFO] Finished at: 2018-05-16T18:41:47+08:00
[INFO] Final Memory: 9M/121M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project sonar-plugin-api: Could not resolve dependencies for project org.sonarsource.sonarqube:sonar-plugin-api:jar:7.0-SNAPSHOT: The following artifacts could not be resolved: org.sonarsource.sonarqube:sonar-check-api:jar:7.0-SNAPSHOT, org.sonarsource.sonarqube:sonar-duplications:jar:7.0-SNAPSHOT, org.sonarsource.sonarqube:sonar-testing-harness:jar:7.0-SNAPSHOT: Could not find artifact org.sonarsource.sonarqube:sonar-check-api:jar:7.0-SNAPSHOT -> [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
Seems like you are adding wrong libraries to the project. Refer this Maven Sonar Api and add the required version of dependency in the pom file and execute mvn clean install instead adding jar file.
Which example are you talking about ?
Your error is that you are building a submodule without building all the module of SonarQube. Go to your clone root and just do a mvn install.

Maven can't download its plugin (as clean), can this situation depend by a proxy configuration issue?

I am not so into Maven and I have the following problem:
I have download a project (that use Spring) from the SVN repository of my company and there are some building errors that seems depends by the fact that some dependencies are missing (for example all the Spring dependencies).
So I tried to select the project and do a Run as ---> Maven Clean as first step before building the project (also if it should perform the clean before the build if I do Maven build but this is not important at this stage) and I obtain this error message:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building GestioneUtenzeCloud 1.0.0-BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: http://srvabc02.soft.it:8888/artifactory/plugins-release/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[INFO] Downloading: http://srvabc02.soft.it:8888/artifactory/plugins-snapshot/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.561 s
[INFO] Finished at: 2015-08-19T12:35:43+02:00
[INFO] Final Memory: 7M/123M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (http://srvabc02.soft.it:8888/artifactory/plugins-release): srvabc02.soft.it: Unknown host srvabc02.soft.it -> [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/PluginResolutionException
So it seems that it can't download the Maven plugin (in this case the clean plugin).
My computer is connected to Internet passing through the company proxy so I think that is can not download the Maven plugin because the proxy is not configured on my Eclipse...is it possible? What can I do to solve this issue?
Solved by myself. I have added the Maven proxy settings into the settings.xml file that is into the .m2 directory.
As explained here on the official documentation: https://maven.apache.org/guides/mini/guide-proxies.html

Installing maven and maven plugins

I have downloaded Apache Maven 3.1.1 on windows xp and the installation works.However,i want to start jetty but i am thinking there is a way i have to tell maven where to find jetty first but i went ahead anyway and i got this
C:\maven>mvn jetty:run
[INFO] Scanning for projects...
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-
metadata.xml
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadat
a.xml
Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata
.xml (22 KB at 3.2 KB/sec)
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-m
etadata.xml (13 KB at 1.8 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.339s
[INFO] Finished at: Thu Jan 23 10:17:40 EAT 2014
[INFO] Final Memory: 5M/13M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'jetty' in the current project and in the plu
gin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repo
sitories [local (C:\Documents and Settings\Karl Meiwes\.m2\repository), central
(http://repo.maven.apache.org/maven2)] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundF
orPrefixException
C:\maven>
Will i have to tell maven where to find jetty and how do i install the jetty plugin?.In this version of maven,i find the plugins directory.Should there be one?.
You'll need to add the plug-in to your pom.xml . Here's the documentation.
Try adding the plugin in pom.xml
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.0.5.v20130815</version>
</plugin>

Categories