Error when importing Maven-GWT project ("No marketplace entries found to handle gwt-maven-plugin") - eclipse

I'm using Eclipse Indigo on Win XP, Maven 3.0.3 and GWT 2.4. I created a Maven-GWT project using the Mavne gwt archetype. Then I opened Eclipse, went to File -> Import, selected Existing Maven Projects, chose the pom for my GWT-Maven project, and then got this dialog:
The errors are
No marketplace entries found to handle gwt-maven-plugin:2.4.0:generateAsync in Eclipse. Please see Help for more information.
No marketplace entries found to handle gwt-maven-plugin:2.4.0:i18n in Eclipse. Please see Help for more information.
No marketplace entries found to handle maven-war-plugin:2.1.1:exploded in Eclipse. Please see Help for more information.
Anyone know how to resolve these errors? It is wreaking havoc when I actually import my project and try and work with it. - Dave

Make sure you are not using the embedded Maven of Eclipse.
Go to Window->Preference ->Maven -> Installation->choose your own maven installation folder there.
EDIT
If your company pays for IDE, you should ask for IntelliJ the IDE for Java, which I would say is better than Eclipse in many ways, not saying Eclipse is not good, that's just a good alternative. And you won't have this issue to start with

If your pom is not specific as to the version of the maven-resources-plugin, that version will come from the superpom. By default, m2e uses an embedded copy of Maven 3.0.x. If the superpom there points to 2.4.3 and your 'outside-of-Eclipse' version asks for something else, then the Maven inside of Eclipse will go looking for 2.4.3 and fail due to the 'offline'.
Fix by configuring m2e to use the Maven installation you are using outside, or turning off 'offline' for one build.
If you want to use maven from your local installation instead of the embedded version that comes with m2e, You have to do this
Windows ==> Preferences ==> Maven ==> Installations ==> Click Add (select your local maven installation directory)
Installation Directory is not where local repository. It is where maven is installed.
After changing try right click on project then,
Maven ----> Update Project

See How to solve "Plugin execution not covered by lifecycle configuration" for Spring Data Maven Builds
You can basically just copy the snippet from http://code.google.com/p/google-web-toolkit/wiki/WorkingWithMaven#POM_changes_needed_for_Eclipse_Indigo and adapt to your plugins and goals.

I am using a different approach with maven, gwt and eclipse.
I am using the maven eclipse plugin to generate a .classpath and .project file and import the project manually into eclipse (not as a maven project).
My configuration for the maven eclipse plugin looks like this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>false</downloadJavadocs>
<buildOutputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</buildOutputDirectory>
<projectnatures>
<projectnature>org.eclipse.jdt.core.javanature</projectnature>
<projectnature>com.google.gdt.eclipse.core.webAppNature</projectnature>
<nature>com.google.gwt.eclipse.core.gwtNature</nature>
</projectnatures>
<buildcommands>
<buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
<buildcommand>com.google.gdt.eclipse.core.webAppProjectValidator</buildcommand>
<buildcommand>com.google.appengine.eclipse.core.projectValidator</buildcommand>
<buildcommand>com.google.gwt.eclipse.core.gwtProjectValidator</buildcommand>
</buildcommands>
<classpathContainers>
<classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
<classpathContainer>com.google.gwt.eclipse.core.GWT_CONTAINER</classpathContainer>
</classpathContainers>
<excludes>
<exclude>com.google.gwt:gwt-servlet</exclude>
<exclude>com.google.gwt:gwt-user</exclude>
<exclude>com.google.gwt:gwt-dev</exclude>
<exclude>javax.validation:validation-api</exclude>
</excludes>
<linkedResources>
<linkedResource>
<name>war</name>
<type>2</type>
<location>${basedir}/target/${project.artifactId}-${project.version}</location>
</linkedResource>
</linkedResources>
</configuration>
</plugin>
Hope that helps

This helped me:
Delete the project from eclipse (but don't delete from disk)
Close eclipse
In your user folder there is .m folder.
Delete repository folder underneath it (.m/repository).
Open eclipse Import project as existing maven project (from disk).

Related

Eclipse Neon + JBossTools + Maven results on error: No compiler is provided in this environment

I'm having some problems when trying to install wildfly.swarm addon (https://github.com/forge/wildfly-swarm-addon) through JBoss Tools on Eclipse
Maven keep telling me that java compiler was not found despite I have JDK correctly set on Eclipse.
But ok, first things first:
I installed Java 8 + Maven v3.3.9 + Eclipse Neon + JBoss Tools. Everything went fine...
Then, I tried to install wildfly.swarm addon (https://github.com/forge/wildfly-swarm-addon) through JBoss Tools.
Forged Console prompted me the following error:
Trying to solve this problem, I checked if JDK path is correct on Eclipse. It is:
I've also checked if system variables for Maven and Java home are correct. Also, everything seems fine:
At last, I went to Windows > Preferences > Maven > Installations on Eclipse
and added a new entry that point's to current Maven directory:
I've been looking some solutions on Stackoverflow and, between some sugestions, someone told to add tools.jar on JRE Definition. So, I did it, then restarted Eclipse, tried again to install wildfly-swarm through Forge Console but again... same error.
Did someone faced this problem as well?
Plus: I also tried to build Widlfly Swarm's example through mv package command and everything went fine:
I'm facing the same problem. I can run mvn install on command line, but not in eclipse. You can temporarily fix this problem by adding this in pom.xml
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<fork>true</fork>
<executable>C:\Program Files\Java\jdk1.8.0_101\bin\javac.exe</executable>
</configuration>
</plugin>

Eclipse not picking up Maven attached source on debug

I've downloaded the source for all the Maven JARs in my buildpath using Maven->Download Sources and mvn eclipse:eclipse -DdownloadSources=true, which worked! When I open up the build path I can see that the sources JARs are attached for every JAR file.
But when I run the damn thing on Tomcat 6 I keep getting "Source not found" page with "Edit Source lookup path" button. But the source is already attached in the build path. What isn't this working?
When I manually point it to the JAR file by clicking on the "Edit Source lookup path" button it works. And when I manually point it to the folder it does not work. Why isn't Eclipse or Tomcat picking up the attached source in the build path?
Note: I'm using apache-maven-3.0.4, apache-tomcat-6.0.16 and Eclipse Indigo Service Release 2.
Although this bug had the most votes of all bugs #Sonatype, it hasn't been fixed.
However I have filled an enhancement request on Eclipse Bugzilla and if you agree this issue "Source not found" should be fixed, please vote for it here.
You can found three workarounds here.
I found this com.ifedorenko.m2e.sourcelookup plugin. The link was provided in "Java Debugging: Source not found".
Go to Help > Install New Software .. and use
http://ifedorenko.github.com/m2e-extras/
to search for the links. After installing this plugin I was finally able to debug the source code of dependencies.
Use External Maven instead of default Embedded in Debug Configurations dialogue.
Please see example screenshot below (menu Run -> Debug Configurations...):
Configure external Maven
Tested environment:
Eclipse IDE for Java Developers: Oxygen.1a Release (4.7.1a), 64-bit (from spring.io)
Oracle JDK jdk1.8.0_144, 64-bit
Maven: 3.5.2
OS: Windows 10 Enterprise N, 64-bit
Test goal hpi:run (sample Jenkins plugin)
Window->Preferences->JBoss Tools->Source Lookup
make sure you have check "Automatically add the JBoss Maven source container to all JBoss As launch configurations".
and under "Automatically configure the Java Source Attachment",
choose "Always".
this helps myself out of the problem.
In my case the problem was related with the source code attached with the "Debug Configuration", maybe some remnants form a migration to Maven.
I solved it by going to the "Debug Configurations..." page and selecting the configuration in case, then at the "Sources" tab I restored the defaults, which added all the project's Maven dependencies.
I think I fixed this for myself by updating my Eclipse m2e.
I think I had version ~1.2, and then updated to latest [as of writing] 1.6.2.
The Eclipse Bug comments helped me figure this out.
Now I can debug into my gquery-dnd-bundle-1.0.6!
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${version.maven-source-plugin}</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
<goal>test-jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
The "target" maven project should emit it's source code before the "client" projects can have access to the source code. I solved the issue by using the maven-source-pluging in the "target" project: https://maven.apache.org/plugins/maven-source-plugin/index.html
Just use the following snippet in the pom.xml file of the target project, make a release, and use the release version into the pom.xml file of the client project. Then eclipse can automatically let you "jump" to the target project seamlesly:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${version.maven-source-plugin}</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
<goal>test-jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>

m2Eclipse plugin with maven 3.0.3, no compilation errors, and jre5 with jdk7

Question about the m2 eclipse plugin. Currently I have "Eclipse Java EE IDE for Web Developers", the most recent update. I have the m2 eclipse plugin installed, and have started a normal java project. I then converted this to a maven project via
"right click->configure->convert to to maven project"
This appears to work, a pom.xml is created, the project converts, and everything is well and good.
The issue starts when I do anything to this project. In the maven settings for the project "Right client on project -> maven" there are several options that are behaving strangely, updating maven configuration will change the default JDK for the project (JDK7) to j2SE-1.5..., which was never installed on the machine, and of course is not found. Also code completion, and and error checking is not working in the editor.
Example:
params.put("some_string", ); This should render "red" for compilation errors because there is no second argument to put(), however this checks out as okay according to the eclipse editor.
I have some done some research on this issue, and from what I can gather from Google, it appears that there are some issues with m2eclipse and this distro of eclipse however there is nothing to resolve this. Is anybody else having similar problems, or does anybody have any idea how to resolve this?
Please let me know if the is any other information I can provide, I didn't want to just paste my settings.xml into stack overflow.
Note: I have my settings.xml configured in Eclipse, and have specifies which jdk to use (7)
System information:
Maven version: 3.0.3
Eclipse Version: Eclipse Java EE IDE for Web Developers Version
All eclipse plugins have the most recent versions installed as of this post date, and there are no XML integrity errors, or anything of the sort.
For the JDK issue: in your pom.xml specify
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<showWarnings>true</showWarnings>
</configuration>
</plugin>
and then do another "Update Project configuration". Then the JDK 7 should be set (at least works for me).
Okay, so the answer to this is the answer to so many other questions on Stack overflow and other sites.... "mvn eclipse:eclipse". I was under the impression that Eclipse "did this for you" on project startup, and that is apparently not the case. After running that on a brand new work-space after an eclipse re-install (new computer) everything works fine.
I felt the need to close this one out. Thanks for the help though.

Eclipse:Run on server option not visible for maven project

I'm running through the jboss as7 getting started guide here http://hudson.jboss.org/jenkins/job/JBoss-AS7-Docs/lastSuccessfulBuild/artifact/guides/developer-getting-started-guide/target/docbook/publish/en-US/html/helloworld.html . The tutorial has us setting up an example helloworld quickstart maven project.
I'm able to deploy this project from the command line successfully
mvn package jboss-as:deploy
but when I attempt to deploy the helloworld example from Eclipse - the 'run on server' option is missing from the run menu. I have Eclipse 3.7 and maven wtp installed.
Not sure how to fix, any advice appreciated.
The run on server related options only appears if your project has the Dynamic Web Moudle project facets.
You can try to configure it using the Project Facets options in your project properties
To help any other developer with this problem.
I was dealing with this issue recently. Maven projects are structured differently than Dynamic Web Projects. So when you manually add the Dynamic Web Module using Project Facets, eclipse may not register it properly as a Maven project.
To solve this, you have to install the m2e plugin and M2E Eclipse WTP plugin (this tells Eclipse how to run your maven projects).
Go to Help -> Eclipse Marketplace to search for the plugins.
After installing, you will need to restart Eclipse then you will be able to use "run on server" for your Maven projects.
Note: You may need to remove/delete the previous project then import/create it again after the restart.
You have to add maven eclipse pluginin your pom.xml file..
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
</plugin>
According to Red Hat's site, The M2E Eclipse WTP plugin (m2eclipse-wtp) has been deprecated in favor of the newer m2e-wtp plugin. If you don't want to go through the marketplace, the URL for the new plugin is http://download.eclipse.org/technology/m2e/releases.
After copying the project and refreshing it, closing and reopening it, removing and re-adding it (right-click on server) and updating Maven... the option reappeared.
I think it occurs when you up the version of the Java compiler in your .pom file, when you up the compiler in project properties or it has to do with using the newer Jersey (2) version or when you both include local libraries and maven dependencies, it may also be a consequence of a combination of these. It's pretty unclear.
Note though, that you can still add/remove projects by right-clicking on the server in the servers tab.

Generate Web Application Project for Eclipse using Maven.

I'm new to this approach. I've used Maven, Tomcat and Eclipse for my web application. But I'm trying the approach where you create a Maven project using an archetype plugin.
My goal is to create a Web Application Project for Eclipse using Maven that can then be imported into Eclipse. I'm pretty sure there is a super-easy way to do this and I want to know what it is.
I'm using Tomcat 6, Eclipse Helios and Maven 2.
I was referring to this 3-part post:
http://united-coders.com/phillip-steffensen/maven-2-part-1-setting-up-a-simple-apache-maven-2-project
But when I imported the project into Eclipse, I couldn't see the Run As > Run on server option.
What is the best way to go about this? Any links to resources that'd help me understand the approach would be great!
My goal is to create a Web Application Project for eclipse using maven that can then be imported into Eclipse. I'm pretty sure there is a super-easy way to do this and I want to know what it is.
Use the maven archetype plugin to generate your project. Here is how to tell it to use the maven-archetype-webapp when invoking it from the command line:
mvn archetype:generate -DarchetypeArtifactId=maven-archetype-webapp
But when I imported the project into eclipse, I couldn't see the Run As > Run on server option.
It actually all depends on what you use for Eclipse/Maven integration. There are basically two options (and they both provide WTP integration):
the maven-eclipse-plugin which is a Maven plugin that can generate Eclipse files (.project and .classpath and so on) allowing to import the project as Existing projects into Workspace.
the m2eclipse plugin which is an Eclipse Plugin providing Maven integration inside Eclipse and allowing to import a Maven project as Existing Maven projects.
The maven-eclipse-plugin approach
If you use the maven-eclipse-plugin, you have to configure it for WTP support and here is a typical configuration:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.8</version>
<configuration>
<projectNameTemplate>[artifactId]-[version]</projectNameTemplate>
<wtpmanifest>true</wtpmanifest>
<wtpapplicationxml>true</wtpapplicationxml>
<wtpversion>2.0</wtpversion>
<manifest>${basedir}/src/main/resources/META-INF/MANIFEST.MF</manifest>
</configuration>
</plugin>
With this configuration, running mvn eclipse:eclipse on your maven project will generate the WTP files so that the project can be recognized as a Dynamic project (i.e. runnable on a Server). Then import it via Import... > Existing projects into Workspace.
The m2eclipse approach
If you use the m2eclipse plugin (and that would be my recommendation), make sure to install the Maven Integration for WTP from the extras. From the install instructions:
Installing m2eclipse Extras
To install optional m2eclipse
components, you will need to use the
m2eclipse Extras update site. This
update site contains the following
m2eclipse components:
Maven SCM Integration
Maven SCM handler for Team/CVS
Maven SCM handler for Subclipse
Maven issue tracking configurator for Mylyn 3.x
Maven Integration for WTP
M2Eclipse Extensions Development Support
m2eclipse Extras Update Site: http://m2eclipse.sonatype.org/sites/m2e-extras
And then just import your project via Import... > Existing Maven projects and if it's a webapp, it should get recognized as a Dynamic project.
Indigo: m2eclipse approach for Indigo is different. See Maven/Tomcat Projects In Eclipse Indigo/3.7
Important: Note that both approaches are exclusive, use one or the other. But in both cases, there is no need to add a facet manually if you use them correctly.
Download and install the eclipse maven plugin from here. Create your project using the new project wizard in eclipse. Select Maven project and create the project using the archetype you discussed. Set appropriate source folders and add libraries used as part of project properties. This should set you up for your project.
Very simple,
you only have to create a new Maven project with packaging type ‘war’ and directories creation done automatically