No marketplace entries found to handle yeoman-maven-plugin - eclipse

I have recently installed and created an application with JHipster. When i run the app in terminal with "mvn spring-boot:run", the app runs without problem.
But when i import the project (as a maven project) into Eclipse, i have this error in my pom:
No marketplace entries found to handle yeoman-maven-plugin:0.4:build
in Eclipse. Please see Help for more information.
Here is a screenshot of the error.
This is how this plugin is defined in the generated pom.xml by default:
<build>
<plugins>
<plugin>
<groupId>com.github.trecloux</groupId>
<artifactId>yeoman-maven-plugin</artifactId>
<version>0.4</version>
<executions>
<execution>
<id>run-grunt</id>
<phase>generate-resources</phase>
<goals>
<goal>build</goal>
</goals>
<configuration>
<skipTests>true</skipTests>
<buildTool>grunt</buildTool>
<buildArgs>compass:server --force</buildArgs>
</configuration>
</execution>
</executions>
<configuration>
<yeomanProjectDirectory>${project.basedir}</yeomanProjectDirectory>
</configuration>
</plugin>
</plugins>
</build>
How can i continue to manipulate, edit the generated project files in my Eclipse?

Eclipse lifecycle-mapping issue is described here:
http://www.eclipse.org/m2e/documentation/m2e-execution-not-covered.html
There is not m2e connector for yeoman-maven-plugin
Recommended way to deal with this issue it to ignore executing this plugin by m2e:
<build>
<plugins>
<pluginManagement>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
com.github.trecloux
</groupId>
<artifactId>
yeoman-maven-plugin
</artifactId>
<versionRange>
[0.4,)
</versionRange>
<goals>
<goal>build</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
Note that executing maven from Eclipse is not affected.

As Mateusz Balbus said you have to modify the pom.xml, but with a small difference as we can find here :
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
com.github.trecloux
</groupId>
<artifactId>
yeoman-maven-plugin
</artifactId>
<versionRange>
[0.4,)
</versionRange>
<goals>
<goal>build</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>

Related

How do you get output from a maven plugin in Eclipse when using the m2e lifecycle-mapping?

I'm unable to get any output from the custom java class (SchemaGenerator) to output in the Eclipse Maven console. Is there a way to do this? The class currently uses sys out and sys err, which appears in the output when using mvn from command line.
<build>
<!-- allow m2e to trigger the exec-maven-plugin -->
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<versionRange>[1,)</versionRange>
<goals>
<goal>java</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute>
<runOnConfiguration>true</runOnConfiguration>
<runOnIncremental>true</runOnIncremental>
</execute>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<!-- custom build step -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>SchemaGenerator</id>
<phase>process-resources</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<includePluginDependencies>true</includePluginDependencies>
<includeProjectDependencies>false</includeProjectDependencies>
<mainClass>jit.SchemaGenerator</mainClass>
<arguments>
<argument>${project.build.outputDirectory}</argument>
<argument>schema.xml</argument>
</arguments>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>jit</groupId>
<artifactId>schema-generator</artifactId>
<version>0.0.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

How do you generate resources for inclusion in src/main/resources without that triggering a subsequent build in eclipse

I'm trying to achieve the following in Eclipse:
When a source file changes, run an custom class that's included as part of the project dependencies, this class generates a file which needs to be placed into src/main/resources (such that it will get checked into source control by any developer working on the project). I'd even settle for /generated rather than src/main/resources.
I have the following, which seems to do the right thing, however even though the generated file is being placed into /generated, it triggers a further eclipse build, so essentially a circular loop of builds.
The following triggers m2e into action:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<versionRange>[1,)</versionRange>
<goals>
<goal>java</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute>
<runOnConfiguration>false</runOnConfiguration>
<runOnIncremental>true</runOnIncremental>
</execute>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
The following triggers the custom class:
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>SchemaGenerator</id>
<phase>generate-sources</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>jit.SchemaGenerator</mainClass>
<arguments>
<argument>${project.basedir}/generated</argument>
<argument>schema.xml</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>

Eclipse automatically run maven goals

In my Eclipse/Maven project, how can I call the buildHelper goals add-test-source, add-test-resource and add-resource?
This is my approach:
pom.xml:
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<versionRange>[1.0.0,)</versionRange>
<goals>
<goal>add-test-source</goal>
<goal>add-test-resource</goal>
<goal>add-resource</goal>
</goals>
</pluginExecutionFilter>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compile-plugin</artifactId>
<versionRange>[1.0.0,)</versionRange>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute>
<runOnIncremental>true</runOnIncremental>
</execute>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
lifecycle-mapping-metadata.xml (from Eclipse config):
<?xml version="1.0" encoding="UTF-8"?>
<lifecycleMappingMetadata>
<pluginExecutions>
</pluginExecutions>
</lifecycleMappingMetadata>
To test, I put an empty file into a test resources directory, change a source file, save and check if the empty file is in the corresponding target/ directory afterwards. It isn't.
When I manually run compile test-compile, the test file is getting copied.

Eclipse m2e connector for JAX-WS org.codehaus.mojo

I am trying to consume a webservice using wsimport goal declared at maven build. But I am facing the problem with m2e connectors. There is an error in my POM which says
Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:jaxws-maven-
plugin:1.10:wsimport (execution: default, phase: generate-sources)
I have been trying to install m2e connectors but not getting them even in marketplace. There are other m2e connectors but not for JAX-WS which i need.
I have followed and tried almost each solution mentioned here but all in vain.
Although there is no problem in generating the resources. The resources are generated at build time successfully but this POM error is not allowing my project to get sync with my tomcat and each time I have to deploy the war manually to test even the little changes i make.
All this is really annoying and I need to figure out a solution to this. I am using eclipse juno in this.
Below is the POM file I am using
<build>
<finalName>home</finalName>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>1.10</version>
<executions>
<execution>
<phase>post-clean</phase>
<goals>
<goal>wsimport</goal>
</goals>
</execution>
</executions>
<!-- -->
<configuration>
<wsdlUrls>
<wsdlUrl>http://localhost:8080/email-service/services/EmailService?wsdl</wsdlUrl>
</wsdlUrls>
<sourceDestDir>${project.build.directory}/generated</sourceDestDir>
<verbose>true</verbose>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>additional-resources</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/home/WEB-INF/classes</outputDirectory>
<resources>
<resource>
<directory>${project.basedir}/src/main/webapp/resources/props</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
There is a M2E jaxws-maven-connector GitHub project: https://github.com/trajano/jaxws-maven-connector . It worked for me with Eclipse Kepler and org.codehaus.mojo:jaxws-maven-plugin:1.12.
Choose Install new Software from the Help menu.
Add the repository https://raw.github.com/trajano/jaxws-maven-connector/master/jaxws-connector-update-site/ (see project)
Install m2e connector for jaxws and restart.
Import the Maven project or update the Eclipse Maven project configuration.
Vote for https://github.com/javaee/metro-jaxws-commons/issues/124 and get this fixed in the plugin.
Then you don't need a connector.
In the meantime you can hack this as per Archimedes Trajano's post
Though I did keep the jaxws-maven-connector updated to work with the latest M2E and jaxws-maven-plugin, I found a better way (which I also posted on http://www.trajano.net/2013/12/jaxws-maven-plugin-and-m2e/)
You add the following profile to your pom.xml file to remove the need for a non-discoverable M2E plugin.
<profile>
<id>m2e</id>
<activation>
<property>
<name>m2e.version</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>attach-wsimport-sources</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${basedir}/target/generated-sources/wsimport</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.jvnet.jax-ws-commons
</groupId>
<artifactId>
jaxws-maven-plugin
</artifactId>
<versionRange>
[2.3.1-b03,)
</versionRange>
<goals>
<goal>wsimport</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
As for the jaxws-maven-plugin configuration, just keep it to the defaults as much as possible:
<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.3.1-b03</version>
<configuration>
<wsdlUrls>
<wsdlUrl>http://www.webservicex.net/ConvertAcceleration.asmx?WSDL</wsdlUrl>
</wsdlUrls>
</configuration>
<executions>
<execution>
<id>wsimport</id>
<goals>
<goal>wsimport</goal>
</goals>
</execution>
</executions>
</plugin>

The output directory for the project should be set to /gwtproject/src/main/webapp/WEB-INF/classes

I have created a GWT Maven project in Eclipse using New->Project->Maven project->GWT Eclipse plugin. It was created, but it gives some errors like
The output directory for the project should be set to /gwtproject/src/main/webapp/WEB-INF/classes
Is anything missing while configuring my project?
My pom.xml includes:
<build>
<!-- Generate compiled stuff in the folder used for developing mode -->
<outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<versionRange>[2.4.0,)</versionRange>
<goals>
<goal>resources</goal>
<goal>compile</goal>
<goal>i18n</goal>
<goal>generateAsync</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<versionRange>[2.1.1,)</versionRange>
<goals>
<goal>exploded</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>
An eclipsy solution to this problem is:
Select the project in the Package Explorer.
Open the properties of the project.
Select Java Build Path
Change the default output folder
Question the life decisions you made that landed you in Eclipse.
You should do a pre-check with GWT Article WorkingWithMaven - http://code.google.com/p/google-web-toolkit/wiki/WorkingWithMaven
Also refer GWT Sample project Validation, DynaTableRf and MobileWebApp.
You need to configure the missing part in <webappDirectory> tag in the pom. I think this should solve your problem: Click Here