Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: UnresolvedAddressException - eclipse

I have integrated Maven with Eclipse and trying to create a maven project. Every time i am trying to create project, its POM.xml shows error.
Multiple annotations found at this line:
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile
(execution: default-compile, phase: compile)
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile
(execution: default-testCompile, phase: test-compile)
- CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its
dependencies could not be resolved: Failed to read artifact
descriptor for
org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2:
ArtifactResolutionException: Failure to transfer
org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 from
htt:///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. Original error:
Could not transfer artifact
org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 from/to
central (htt:///repo.maven.apache.org/maven2): null to htt://
repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/2.3.2/maven-compiler-plugin-2.3.2.pom
If I try to run maven-install or any of the maven run option. i get this error
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J:
See htt://www.slf4j.org/codes.html#StaticLoggerBinder for further
details. [INFO] Scanning for projects... [INFO]
[INFO]
------------------------------------------------------------------------ [INFO] Building CQ5 MyApp UI 0.0.1-SNAPSHOT [INFO]
------------------------------------------------------------------------ Downloading:
http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom
[INFO]
------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO]
------------------------------------------------------------------------ [INFO] Total time: 12.289s [INFO] Finished at: Thu Mar 14 14:39:09 IST
2013 [INFO] Final Memory: 1M/15M [INFO]
------------------------------------------------------------------------ [ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or
one of its dependencies could not be resolved: Failed to read artifact
descriptor for
org.apache.maven.plugins:maven-resources-plugin:jar:2.5: Could not
transfer artifact
org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from/to
central (htt://repo.maven.apache.org/maven2): null to
htt://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom:
UnresolvedAddressException -> [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
What should I do?

If you are working on windows like me, just go to C:\Users\Owner.m2\repository and delete all the files in it. Make sure to keep your eclipse close.
Open eclipse and right click on your project, then click on Maven and then in Update Project. A dialog window appears, make sure to have selected ‘clean projects’ and ‘update project configuration from pom.xml’ options.
That should erase all the errors in the project. :)

You do not really have to delete everything from .m2\repository directory. Just the directories for 'problematic libraries', in your example YOUR_MAVEN_REPO.m2\repository\org\apache\maven\plugins\maven-compiler-plugin and delete 2.3.2 folder.
Then right click on the project in Eclipse and Maven->Update Project. You will probably get a different error and you have to repeat the procedure. Do it 3-4 times and it should be fine...

Thank you all for you help and guidance. I got the error myself. I am in a proxy network and was required to set user id and password in settings.xml file of apache maven.

Sounds like you may need to add the sl4j dependency in your pom file. See here: Failed to load class "org.slf4j.impl.StaticLoggerBinder"
Here is the depenedency from the dependency finder in CQ5.5:
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.commons.log</artifactId>
<version>2.1.3-R1232904</version>
<scope>provided</scope>
</dependency>
Hope that helps and good luck.

Related

Сan't run examples. Couldn't find artemis.home error

I get an error when I want to run any example through mvn verify
[ERROR] ********************************************************************************************
[ERROR] Could not locate suitable Artemis.home on either D:\Documents\IdeaProjects\activemq-artemis\examples\features\standard\security\..\..\..\.. or D:\Documents\IdeaProjects\activemq-artemis\examples\features\standard\security\..
\..\..\..\artemis-distribution\target\apache-artemis-2.18.0-SNAPSHOT-bin\apache-artemis-2.18.0-SNAPSHOT
[ERROR] Use the binary distribution or build the distribution before running the examples
[ERROR] ********************************************************************************************
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.087 s
[INFO] Finished at: 2021-02-26T22:03:39+03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.activemq:artemis-maven-plugin:2.18.0-SNAPSHOT:create (create) on project security: Couldn't find artemis.home -> [Help 1]
I tried to specify the path to the directory with artemis at startup, but it does not help mvn verify -Dartemis.home="D:\Documents\apache-artemis-2.17.0"
How to fix this error?
It appears you're running the example directly from the project source since it reports 2.18.0-SNAPSHOT. If that's the case then you should do what the ERROR message indicates:
Use the binary distribution or build the distribution before running the examples
You can get a snapshot binary distribution here or you can build the distribution from the source using mvn install -Prelease -DskipTests.
If you must point the example at a different home directory you can do so using the activemq.basedir system property, e.g.:
mvn verify -Dactivemq.basedir="D:\Documents\apache-artemis-2.17.0"
Or you can change the activemq.basedir property defined in the example's pom.xml.

Why is Maven Build prompting for multiple launch configurations when there is actually none?

In my project (inherited BTW, so some aspects of it are still unknown), under Eclipse/m2e I right-click pom.xml > 1 Maven Build and I get a dialog:
Select a launch configuration to run:
m2 myproj (1):
m2 myproj (2):
m2 myproj (3):
m2 myproj:
But looking at the project's Properties > Run/Debug Settings, there are no launch configurations at all. None whatsoever.
What does that mean?
Should I select one of the 4 configurations listed above? If so, which one and why?
UPDATE 1: Interestingly, when I right-click pom.xml and select Run As > Run Configurations..., I see those configurations defined:
I still don't know what this means, though. I don't recall ever defining them. How did they get there?
UPDATE 2:
Apparently those launch configurations were created inadvertently by clicking some close/cancel button or similar. So I deleted all except for one, then ran it:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.093s
[INFO] Finished at: Wed Dec 05 16:44:24 EST 2012
[INFO] Final Memory: 1M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or
<plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>.
Available lifecycle phases are:
validate, initialize, generate-sources, process-sources, generate-resources,
process-resources, compile, process-classes, generate-test-sources, process-test-sources,
generate-test-resources, process-test-resources, test-compile, process-test-classes,
test, prepare-package, package, pre-integration-test, integration-test,
post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site,
site, post-site, site-deploy. -> [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/NoGoalSpecifiedException
Strange. I know that pom.xml has goals and builds fine when selecting Run As > Maven Install.

PlayN + Eclipse not working. DependencyResolutionException

I've never used PlayN before. I tried following the direction Google gives for it, but all I get is errors. I'm using Eclipse, I've got Maven installed, and I imported the sample projects as directed. I keep getting:
[INFO] Building PlayN Hello Android 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.googlecode.playn:playn-hello-core:jar:1.0-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
This is completely meaningless to me. Can someone explain what is going on? How to resolve it?
It seems that your core's POM is missing, I would recommend that you try to create a new archetype directly from Maven and then try open the project with Eclipse to see if this helps, also you should check that you're using Maven 3, if I remember well Maven 2.X gave some problems creating and building the PlayN archetype.

Overwriting generated target in local maven repository with Maven-Eclipse?

Maven won't overwrite the built version of an eclipse project in my local repository. I only changed a META-INF/MANIFEST.MF file, but Maven doesn't seem to recognize that and therefore doesn't overwrite the artifacts in the local repository. How can I force it to overwrite? This is the maven log:
[INFO]
[INFO] --- maven-jar-plugin:2.2:jar (default-jar) # message ---
[INFO]
[INFO] --- maven-install-plugin:2.3:install (default-install) # message ---
[INFO] **Skipped re-installing C:\dev\ws\Message\target\message-0.0.1.jar to C:\Users\Tim\.m2\repository\samba\message\message\0.0.1\message-0.0.1.jar, seems unchanged**
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.915s
[INFO] Finished at: Fri Sep 03 15:22:12 CEST 2010
[INFO] Final Memory: 7M/175M
[INFO] ------------------------------------------------------------------------
Okay, I think I just saw that Maven doesn't deploy the METAINF/MENIFEST.MF file with the other files in the targets. Seems I have to work on that somehow. Sorry, I'm new to Maven.
Be careful when using RELEASE Versions with maven. You should not "redeploy" them - as the contract is that they will never change anymore. If you deploy a RELEASE Version to a global Maven repository (e.g. Nexus) you will not be able to redeploy it again. You have to build a new Version if changes are necessary.
In phases of development use SNAPSHOT Versions (0.0.1-SNAPSHOT). These can be changed and redeployed.
If you are only working with your local repository the rules are not that strong but you should know about the RELEASE / SNAPSHOT version differences.
The problem was that I used the bundle plugin to generate osgi bundles. With these, the bundle plugin generates it's own MANIFEST.MF file and doesn't use the file that I put into my resources. In fact I also got some error when I tried to use my own MANIFEST.MF file in addition to the one generated by the bundle plugin.

Installing Enclosure with Netbeans

I am having trouble installing Enclosure and getting it to work. I have followed this guide http://www.enclojure.org/gettingstarted and successfully installed Enclosure (I think). However, when I try to build the sample application (labrepl) I get a bunch of errors and a failed build. I haven't used Java in a long time and I've never used Netbeans, and the error doesn't seem very helpful with my limited knowledge of this domain. I'm using the latest Netbeans and the Enclosure URL from the guide. Since I am on Windows, I can't use git to clone the repo, so I'm not sure what to do from here.
Anyway, here are the error messages.
WARNING: You are running embedded Maven builds, some build may fail due to incompatibilities with latest Maven release.
To set Maven instance to use for building, click here.
Scanning for projects...
[#process-resources]
[resources:resources]
Using default encoding to copy filtered resources.
[#compile]
[ERROR]Transitive dependency resolution for scope: compile has failed for your project.
[ERROR]Error message: Missing:
[ERROR]----------
[ERROR]1) org.clojure:clojure-contrib:jar:1.2.0-master-SNAPSHOT
[ERROR] Try downloading the file manually from the project website.
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=org.clojure -DartifactId=clojure-contrib -Dversion=1.2.0-master-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=org.clojure -DartifactId=clojure-contrib -Dversion=1.2.0-master-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR] Path to dependency:
[ERROR] 1) labrepl:labrepl:jar:0.0.1
[ERROR] 2) org.clojure:clojure-contrib:jar:1.2.0-master-SNAPSHOT
[ERROR]----------
[ERROR]1 required artifact is missing.
[ERROR]for artifact:
[ERROR] labrepl:labrepl:jar:0.0.1
[ERROR]from the specified remote repositories:
[ERROR] central (http://repo1.maven.org/maven2),
[ERROR] clojars (http://clojars.org/repo/),
[ERROR] incanter (http://repo.incanter.org),
[ERROR] clojure-snapshots (http://build.clojure.org/snapshots),
[ERROR] clojure (http://build.clojure.org/releases),
[ERROR] clojure-releases (http://build.clojure.org/releases)
[ERROR]Group-Id: labrepl
[ERROR]Artifact-Id: labrepl
[ERROR]Version: 0.0.1
[ERROR]From file: C:\Users\chloey\Documents\NetBeansProjects\RelevanceLabRepl\pom.xml
------------------------------------------------------------------------
For more information, run with the -e flag
------------------------------------------------------------------------
BUILD FAILED
------------------------------------------------------------------------
Total time: 1 second
Finished at: Wed Jun 09 21:53:04 CDT 2010
Final Memory: 72M/172M
------------------------------------------------------------------------
Thanks all.
the missing artifact is the artifact itself. What command are you using to build it? Try mvn clean install on the command line if everything else fails.
I had the same problem so I did a clean install of Netbeans followed by and install of maven both to no avail.
When I went to download the missing artifact I noticed that clojure-contrib version 1.2.0 was not available for download. Changing the pom.xml to look for version 1.1.0 resulted in a successful build.
Open the pom.xml and change
<dependency>
<groupId>org.clojure</groupId>
<artifactId>clojure-contrib</artifactId>
<version>1.2.0-master-SNAPSHOT</version>
</dependency>
to
<dependency>
<groupId>org.clojure</groupId>
<artifactId>clojure-contrib</artifactId>
<version>1.1.0-master-SNAPSHOT</version>
</dependency>
By the looks of things some additional functionality within 1.2.0 is needed for labrepl not sure from where to download it.