Unable to create a maven project in eclipse - eclipse

I am trying to create a maven project and its showing the below error
Could not calculate build plan: 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
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
I have m2e plugin installed in my eclipse and the system variable is also set.
C:\Users\852346>mvn -v
Apache Maven 3.3.1 (cab6659f9874fa96462afef40fcf6bc033d58c1c; 2015-03-14T01:40:2
7+05:30)
Maven home: D:\apache-maven-3.3.1
Java version: 1.7.0_25, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jre7
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"**
But I am still getting the same error.

I found the answer, I forgot to add the proxy server I was using in settings.xml file in .m2/ directory.

Related

Using graphql plugin in grails ends up with: java.lang.ClassNotFoundException: org.grails.compiler.web.converters.RenderConverterTrait

I try to make my 1st experience with graphql in the grails context.
I'm using:
jdk1.8.0_162
Eclipse Java EE IDE for Web Developers.
Version: Oxygen.2 Release (4.7.2)
Build id: 20171218-0600
OS: Linux, v.4.4.0-116-generic, x86_64 / gtk 3.18.9
Grails Version: 3.3.3
Groovy Version: 2.4.14
In build.gradle I entered the graphql-plugin via
compile "org.grails.plugins:gorm-graphql:1.0.3.BUILD-SNAPSHOT"
in the dependencies section. Starting grails ends up with build successful, run-up ends up in
java.lang.ClassNotFoundException: org.grails.compiler.web.converters.RenderConverterTrait
Any hints on Incompatibilities or missing entries in build.gradle?
Peter
Please change dependency from
compile "org.grails.plugins:gorm-graphql:1.0.3.BUILD-SNAPSHOT"
To
compile 'org.grails.plugins:converters:3.3.1'
OR
compile "org.grails.plugins:converters"
This is the Converters plugin that has been part of Grails core up until version 3.3 and now is a standalone plugin.
Users of Grails 3.3.x and above should use this plugin.
see plugin repository here
Hope this will helps you

How to import netty to eclipse without pom errors?

I want to learn the source code of netty, and I import the source code of netty from github, I use maven to import these code but there are some pom errors here when I import the project:
I searched the Internet but I can't get any useful information.So I have nothing to do but to ask for help.
ps,
I attempt to follow the steps here:
and the solution is :
Set up Eclipse with M2E and Java 7/8
Ensure to use the 64-bit version of Eclipse.
Download os-maven-plugin and put it into /plugins (Eclipse 4.5) or /dropins (Eclipse 4.6) directory to work around the problem where m2e does not evaluate an extension specified in our pom.xml. (Unlike its name, it's both a Maven plugin and an Eclipse plugin.)
Import the project via the 'File → Import... → Existing Maven Projects' menu.
Netty project Maven pom.xml settings dictate use of Java SE 1.6, while implicitly using Java 7/8 (1.7/1.8) features if present. This may result in compilation errors in Eclipse. There are two ways to work around this problem:
Look in the 'Window → Preferences → Installed JRE' menu:
Make sure you have Java 7/8 installation available under 'Installed JRE'
Map this Java 7/8 installation onto Java 6: 'Installed JRE → Execution Environments → Java SE 1.6'
Alternatively, Java 7/8 JRE can be selected on per-project basis for each Netty module.
I follow these steps but I cant't solve this problem.
could you please help me to solve this problem? I look forward to your help.
my OS information:
ProductName: Mac OS X
ProductVersion: 10.13.3
BuildVersion: 17D102
my jdk information:
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
my eclipse information:
my maven information:
Apache Maven 3.5.0 (ff8f5e7444045639af65f6095c62210b5713f426; 2017-04-04T03:39:06+08:00)
Maven home: /Users/mingxing/development/tools/apache-maven-3.5.0
Java version: 1.8.0_131, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.3", arch: "x86_64", family: "mac"

jbake plugin requires maven upgrade in eclipse

I'm using a maven plugin in my POM file. When I build the project, I get an error:
`[ERROR] Failed to execute goal br.com.ingenieux:jbake-maven-plugin:0.0.9:generate (default-cli) on project uts-documentation: The plugin br.com.ingenieux:jbake-maven-plugin:0.0.9 requires Maven version 3.1.1 -> [Help 1]`
My embedded maven version is 3.0.4. How can I update to the required version without installing a separate instance of maven (would like to avoid that if possible)?
Upgrading to a more recent Eclipse version will bring an updated embedded version of Maven. For example the Eclipse Luna installation that I am running has Maven 3.2.1 embedded.

maven in command line succeed, but failed when using the same maven in eclipse

I'm trying to build the project of hadoop. I followed the official document as follows on how to do that.
http://wiki.apache.org/hadoop/HowToContribute
https://wiki.apache.org/hadoop/EclipseEnvironment
I've git clone the project, maven install it successfully, but when I import the project, or even a sub-project like 'hadoop-yarn-api', I got the following errors on maven:
Description Resource Path Location Type
Plugin execution not covered by lifecycle configuration: org.apache.hadoop:hadoop-maven-plugins:3.0.0-SNAPSHOT:protoc (execution: compile-protoc, phase: generate-sources) pom.xml /hadoop-yarn-api line 73 Maven Project Build Lifecycle Mapping Problem
Then I'm trying to mvn clean install the project via External Tools Configuration in eclipse, it also failed on:
[ERROR] Failed to execute goal org.apache.hadoop:hadoop-maven-plugins:3.0.0-SNAPSHOT:protoc (compile-protoc) on project hadoop-yarn-api: org.apache.maven.plugin.MojoExecutionException: 'protoc --version' did not return a version -> [Help 1]
But the curious part is that when I cd into the root directory of 'hadoop-yarn-api' and invoke mvn clean install, it can be built successfully.
I'm using m2ecipse in eclipse, and I'm sure that I've changed to the maven which is exactly the one that I'm used in command line, not the embedded one.
And I've installed protocol buffers 2.5.0:
$ protoc --version
libprotoc 2.5.0
Could anyone give me some idea? Many thanks!
P.S.
Eclipse Java EE IDE - Juno Service Release 2
m2e - 1.4.1.20140328-1905
Mac 1- 0.9.4
maven - 3.0.5
Hadoop - 2.2.0

bootstrap class path not set in conjunction with -source 1.6

I am upgrading my application from java 1.6 to 1.7. When I try to build using Maven 3.2.1, my build fails with below error msg:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project my-app5: Compilation failure: Compilation failure:
[ERROR] could not parse error message: warning: [options] bootstrap class path not set in conjunction with -source 1.6
I am using java 1.7 hotspot and previously I was using 1.6 jrockit. My application is multi module and few modules compile and build as usual, this module failed.
I have set java home properly and mvn --version shows below output:
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T23:07:52+05:30)
Maven home: C:\Users\me\Maven3\apache-maven-3.2.1-bin\apache-maven-3.2.1\bin\..
Java version: 1.7.0_51, vendor: Oracle Corporation
Java home: C:\Program Files\jdk17051\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
Am I missing anything?
I solved it using below configuration in my compiler plugin:
<fork>true</fork>
<executable>${JAVA_HOME}/bin/javac</executable>
<compilerVersion>1.7</compilerVersion>
<source>1.7</source>
<target>1.7</target>
This will use the JDK which you have defined in your JAVA_HOME environment property.
Quote from this post:
Java 5.0 and 6 used to have poor support for compiling classes to
target older versions of Java. It always supported the previous
version, but often no more. Even if you could compile for previous
version, you had to be careful not to use functionality which did
exist in the previous versions.
You should either include -Xbootclasspath when using javac:
javac -Xbootclasspath:/path/to/jdk6/rt.jar -target 1.6 -source 1.6 Main.java
or compile using -target 1.7 (or higher of course):
javac -target 1.7 -source 1.7 Main.java
or use javac of jdk 6:
/path/to/jdk6/bin/javac Main.java