Maven Problem - Failed to Look for File 501 - eclipse

Relatively unfamiliar with Maven.
Im trying to set up a shared project in my laptop.
I've heard there's apparently a security issue with the Maven Repo, so, in the pom.xml, I added this to the <repositories>
<repository>
<id>central</id>
<name>Central Repository</name>
<url>https://repo.maven.apache.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
But, on top of still getting a 501 error, this is what Im seeing:
Failed to look for file: http://repo.maven.apache.org/maven2/http://repo.maven.apache.org/maven2/org/codehaus/mojo/gwt-maven-plugin/2.4.0/gwt-maven-plugin-2.4.0.pom.
Why is it appending to the URL instead of replacing it?
Failure to transfer org.codehaus.mojo:gwt-maven-plugin:pom:2.4.0 from 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. Original error: Could not transfer artifact org.codehaus.mojo:gwt-maven-plugin:pom:2.4.0 from/to central (http://repo.maven.apache.org/maven2): Failed to look for file: http://repo.maven.apache.org/maven2/http://repo.maven.apache.org/maven2/org/codehaus/mojo/gwt-maven-plugin/2.4.0/gwt-maven-plugin-2.4.0.pom.
And this is the follow-up message.

Related

Apache Beam: PubsubReader fails with NPE

I have a a beam pipeline that reads from PubSub and write to BigQuery after applying some transformation. The pipeline fails consistently with a NPE. I am using beam SDK version 0.6.0. Any Idea on what I could be doing wrong? I am trying to run the pipeline with a DirectRunner.
java.lang.NullPointerException
at org.apache.beam.sdk.io.PubsubUnboundedSource$PubsubReader.ackBatch(PubsubUnboundedSource.java:640)
at org.apache.beam.sdk.io.PubsubUnboundedSource$PubsubCheckpoint.finalizeCheckpoint(PubsubUnboundedSource.java:313)
at org.apache.beam.runners.direct.UnboundedReadEvaluatorFactory$UnboundedReadEvaluator.getReader(UnboundedReadEvaluatorFactory.java:174)
at org.apache.beam.runners.direct.UnboundedReadEvaluatorFactory$UnboundedReadEvaluator.processElement(UnboundedReadEvaluatorFactory.java:127)
at org.apache.beam.runners.direct.TransformExecutor.processElements(TransformExecutor.java:139)
at org.apache.beam.runners.direct.TransformExecutor.run(TransformExecutor.java:107)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
This problem exists because of a Bug (BEAM-1656) in the DirectRunner and a precondition within PubsubCheckpoint. The bug in the DirectRunner was fixed in pull request 2237, which is merged into the Github master branch, but after 0.6.0 release.
Updating to the 0.7.0 nightly build or building from github HEAD will solve this problem when using the DirectRunner.
To update to the current nightly build you will have to add the following repositories to your project's pom.xml. The earliest version of the beam-runners-direct-java module containing the fix is 0.7.0-20170316.070901-9, but not all modules are built with this specific version so you may have to either specify individually compatible versions or use 0.7.0-SNAPSHOT
<repositories>
<repository>
<id>apache.snapshots</id>
<name>Apache Development Snapshot Repository</name>
<url>https://repository.apache.org/content/repositories/snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

Resolve oltu openid connect dependency in maven

This is not a question but a simple maven dependency solution of oltu openid connect that I like to share. I found it might be helpful to other as there's not too many resource about it on the web.
I was having a problem with oltu openid connect dependency in maven (pom). Somehow I found its groupid, artifact, and its version. But whenever I insert the dependency in pom, eclipse notifies me with missing artifact. The problem seemed like this:
The problem was as above mentioned that the dependency was not available in maven central repository. As I searched through web, I found those dependencies are hosted in other repository which is http://repository.idega.com/maven2/. After that, the solution was just to include this repository in your pom like shown below:
Try using the Apache Snapshot Repository:
<repositories>
<repository>
<id>apache.snapshots</id>
<name>Apache Snapshot Repository</name>
<url>https://repository.apache.org/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
</repository>
</repositories>

Pom error in Eclipse

I have a Maven project in Eclipse and if I try to run Maven > Update project I get the following error
Failure to transfer org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from 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. Original error: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from/to central (http://repo.maven.apache.org/maven2): java.net.ConnectException: connection timed out to http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.5/maven-resources-plugin-2.5.pom
I tried to run Maven with the embedded installation and an external one - same result.
I don't have any proxy set up in Eclipse and I don't need one.
I do not reference the plugin in my POM.
Running mvn eclipse:eclipse in console works perfectly.
I'm using Eclipse Kepler and m2e 1.4.0.201.
The parent POM is
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>
Anyone have any idea why?
Adding
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
</plugin>
</plugins>
</pluginManagement>
solved the problem.
Here's the error I was getting initially:
Failure to transfer org.sonatype.oss:oss-parent:pom:9 from
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. Original error:
Could not transfer artifact org.sonatype.oss:oss-parent:pom:9
from/to central (http://repo.maven.apache.org/maven2): Address family
not supported by protocol family: connect
I didn't need to introduce any additional maven plugins, simply enclosing the existing plugins inside <pluginManagement> tag as described here: How to solve "Plugin execution not covered by lifecycle configuration" for Spring Data Maven Builds solved it for me - hopefully it will help someone else as well.

Add Maven repositories for a project in Eclipse?

How can I add Maven repositories for a project. I'm using Eclipse Juno version: Juno Service Release 1 Build id: 20120920-0800 and using Fedora as my OS.
You can include it in your pom.xml. Just add the repositories information inside the <project> tag
<repositories>
<repository>
<id>maven-restlet</id>
<name>Public online Restlet repository</name>
<url>http://maven.restlet.org</url>
</repository>
</repositories>
You have to add the repository to your settings.xml: Maven Settings Reference. For example:
<repositories>
<repository>
<id>codehausSnapshots</id>
<name>Codehaus Snapshots</name>
<releases>
<enabled>false</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<url>http://snapshots.maven.codehaus.org/maven2</url>
<layout>default</layout>
</repository>
</repositories>
Check the settings in eclipse Window -> Preferences -> Maven -> Installations to see where this file is located.
You can also add a repository in the pom.xml of your project to make it available for this project only.
For new installation, follow below steps:
From the Windows “Start” button on the menu,
select the “Run” menu item.
Into the dialog box, enter the command “cmd” and press the “Ok” button.
This will open a command window with a shell prompt.
Type cd “C:/Documents and Settings/<windows username>”/
Type mkdir .m2
Type cd .m2
Type notepad settings.xml.
This will open a new document in Notepad and show you a warning “Cannot find the settings.xml file. Do you want to create a new file?”. Select “Yes”.
Enter the following code into the document:
<settings>
<localRepository>
D:/mavenrepository (Give here path of your choice)
</localRepository>
</settings>
Save the file and close out of notepad.
Congrates, You are done.
Happy Learning !!
from http://howtodoinjava.com/2013/01/04/how-to-change-maven-local-repository-path-in-windows/

building spring batch sample application

I am trying to build the sample application for spring batch 2.1.6. (ie. spring-batch-2.1.6.RELEASE/samples/spring-batch-samples) using maven but am getting this error for a missing plugin:
[ERROR] Plugin
com.springsource.bundlor:com.springsource.bundlor.maven:1.0.0.RELEASE
or one of its dependencies could not be resolved: Failure to find
com.springsource.bundlor:com.springsource.bundlor.maven:jar:1.0.0.RELEASE
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 ->
Is there another repository I can set up to get this plugin? I am a bit suprised to be getting this errror as this is the latest realease version of spring batch.
Here is the repository section from the pom as it came in the download:
<repositories>
<repository>
<id>com.springsource.repository.bundles.external</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Bundle External</name>
<url>http://repository.springsource.com/maven/bundles/external</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
The project's parent pom has a bootstrap profile which contains the necessary repository definitions. Build the project with the command mvn test -P bootstrap and it will download the dependencies.
P.S. This is explained in the readme's instructions that how to build Spring Batch. It would be good if they would also tell how to do it in the instructions for using the samples - maybe you could file a bug report?
i am using maven3 and was able to solve this problem by adding this to my pom:
<pluginRepositories>
<pluginRepository>
<id>plugin.repo.maven.central2</id>
<url>http://objectstyle.org/maven2/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
The Spring batch Admin sample build is broken for sure. At least as of today.
The -Pbootstrap doesn't help and adding the repos in that profile in my local settings doens't help either.
When I attempted to build spring-batch-admin-sample, I found that I was missing dependencies of spring batch!
So I went to build that. There I found that I was missing org.neo4j:neo4j-cypher-dsl-1.9.M04 and also gemfire.7.0.1.jar. Adding repos doesn't help because of the maven2/3 incompatibility issues.
So a sure way to fix this is to go to each repo, download the missing dep and mvn install-file them.
So get the neo4j one here:
http://m2.neo4j.org/content/repositories/releases/org/neo4j/neo4j-cypher-dsl/1.9.M04/
Get the gemfire one from here:
https://repo.springsource.org/gemstone-release-cache/com/gemstone/gemfire/gemfire/7.0.1/
And then I ran into a foundrylogic.vpp dependency that I found here:
http://objectstyle.org/maven2/foundrylogic/vpp/vpp/2.2.1/
Don't forget to get the corresponding poms also to keep it clean and get all the transitives, if any.
Use the mvn install-file plugin described here to get all three deps to your local repo.
http://maven.apache.org/plugins/maven-install-plugin/usage.html
Now spring-batch should build clean.
Now if you go to build spring-batch-admin it will still fail because it depends on spring-batch-core-2.2.3.BUILD-SNAPSHOT whereas what we just built was version 3.0.0.BUILD-SNAPSHOT.
So go to spring-batch-admin-parent's pom and modify the pom like so:
<!-- <spring.batch.version>2.2.3.BUILD-SNAPSHOT</spring.batch.version> -->
<spring.batch.version>3.0.0.BUILD-SNAPSHOT</spring.batch.version>
And then step back to spring-batch-admin and mvn clean install should build the sample.
Hope this helps someone!
I installed maven 3.2.1 and it works.