Re: [jbehave-user] How to get working JBehave sources in Eclipse?
This is precisely what the ignore functionality does - it updates the workspace lifecycle mapping metadata.It is supported in 4.3 - but you may have an older version of the m2e plugin. In any case, I've added it to source control (under ides/eclipse) and updated README. Please try reloading this from Preferences Maven Lifecycle Mappings. On 29/04/2014 11:59, Hans Schwäbli wrote: Maybe Eclipse 4.4 has this feature, I haven't discovered it in 4.3. I created a lifecycle mappings metadata which solves this problem (such things could be added to a Wiki for instance): ?xml version=1.0 encoding=UTF-8? lifecycleMappingMetadata !-- Why this is needed for Eclipe: http://wiki.eclipse.org/M2E_plugin_execution_not_covered -- pluginExecutions pluginExecution pluginExecutionFilter groupIdorg.jbehave/groupId artifactId jbehave-maven-plugin /artifactId versionRange [4.0-SNAPSHOT,) /versionRange goals goal unpack-view-resources /goal /goals /pluginExecutionFilter action ignore/ignore /action /pluginExecution pluginExecution pluginExecutionFilter groupId org.jvnet.hudson.tools /groupId artifactId maven-hpi-plugin /artifactId versionRange [3.0.1,) /versionRange goals goalinsert-test/goal goaltest-hpl/goal goal resolve-test-dependencies /goal /goals /pluginExecutionFilter action ignore/ignore /action /pluginExecution pluginExecution pluginExecutionFilter groupIdorg.scala-tools/groupId artifactId maven-scala-plugin /artifactId versionRange [2.9.1,) /versionRange goals goaladd-source/goal goalcompile/goal goaltestCompile/goal /goals /pluginExecutionFilter action ignore/ignore /action /pluginExecution pluginExecution pluginExecutionFilter groupIdde.saumya.mojo/groupId artifactId jruby-maven-plugin /artifactId versionRange [0.29.1,) /versionRange goals goalcompile/goal /goals /pluginExecutionFilter action ignore/ignore /action /pluginExecution /pluginExecutions /lifecycleMappingMetadata On Mon, Apr 28, 2014 at 11:02 PM, Mauro Talevi mauro.tal...@aquilonia.org mailto:mauro.tal...@aquilonia.org wrote: Yes, the m2e plugin is very annoying in this. IMO it's one of the worst design decisions they've made when migrating from the original m2eclipse plugin. But with recent versions, Eclipse allows you to mark as ignored these errors without modifying the pom.xml. The feature is marked as experimental but it's stable and works fine. It stores the info to be ignored in the workspace (I'm not sure if it can exported and re-imported easily though). This is why the source code is not polluted with the pom.xml modifications - as you say to preserve IDE neutrality. On 28/04/2014 14:46, Hans Schwäbli wrote: Thank you. I forgot about the page which explains the JBehave source building. So I didn't see that I need to use that settings.xml file. But I think my biggest mistake was when importing the maven project into Eclipse. The import wizard shows me the plugins which can't be found. There I can choose in a little dropdown that m2e writes into the pom.xml that these plugins are ignored. It works now with that approach. However, you could add these settings into the pom.xml parent file, so it would be no problem to import the maven projects into Eclipse. But I am afraid that you want to be IDE neutral. In that case a documentation on how to import JBehave sources into Eclipse would be nice. I would be willing to contribute if you provide some Wiki for JBehave (because I cannot commit anything in Github from the company and it is too much overhead to create HTML pages for me). On Fri, Apr 25, 2014 at 4:49 PM, Cristiano Gavião cvgav...@gmail.com mailto:cvgav...@gmail.com wrote: first things you must learn before are:
Re: [jbehave-user] How to get working JBehave sources in Eclipse?
On 29-04-2014 10:29, Hans Schwäbli wrote: It is a bit more tricky than I thought to get that sources working in Eclipse. First I have to check jbehave-core out. But then I don't must import it into Eclipse. First I have to configure the settings.xml with the company proxy settings I need and build everything with: mvn -s settings.xml clean install -Dmaven.test.skip=true why don't you just copy the profiles/repositories specified in the provided settings.xml to your ~user/.m2/settings.xml? If I don't do this but import the projects into Eclipse, then JBehave dependencies are downloaded from the maven repository instead of using the checked out ones. Jbehave snapshots jars are not being deployed into any remote repository (at least not that I know) so I think this is not true. m2e will get those dependencies from your local repository only if they aren't imported in the eclipse workspace... Then I need to configure Eclipse so that it uses the Maven lifecycleMappingMetadata. Below I updated it for the maven-dependency-plugin exclusion (see below). version 1.5 of m2e (http://download.eclipse.org/technology/m2e/milestones/1.5 ) has the feature that Mauro have said... it is just a matter of choose the option and you don't need to deal with POM changes... In Eclipse I must use the settings.xml file from JBehave. Now I finally can import the projects into Eclipse (as Maven projects). After it builds I have just one compile error: JRubySteps cannot be resolved to a type. I can ignore that (delete the JRuby example project). There are quite some pitfalls, at least for my brain. ?xml version=1.0 encoding=UTF-8? lifecycleMappingMetadata !-- Why this is needed for Eclipe: http://wiki.eclipse.org/M2E_plugin_execution_not_covered -- pluginExecutions pluginExecution pluginExecutionFilter groupIdorg.apache.maven.plugins/groupId artifactIdmaven-dependency-plugin/artifactId versionRange[1.0.0,)/versionRange goals goalcopy-dependencies/goal goalunpack/goal /goals /pluginExecutionFilter action ignore / /action /pluginExecution pluginExecution pluginExecutionFilter groupIdorg.jbehave/groupId artifactId jbehave-maven-plugin /artifactId versionRange [3.10-SNAPSHOT,) /versionRange goals goal unpack-view-resources /goal /goals /pluginExecutionFilter action ignore/ignore /action /pluginExecution pluginExecution pluginExecutionFilter groupId org.jvnet.hudson.tools /groupId artifactId maven-hpi-plugin /artifactId versionRange [3.0.1,) /versionRange goals goalinsert-test/goal goaltest-hpl/goal goal resolve-test-dependencies /goal /goals /pluginExecutionFilter action ignore/ignore /action /pluginExecution pluginExecution pluginExecutionFilter groupIdorg.scala-tools/groupId artifactId maven-scala-plugin /artifactId versionRange [2.9.1,) /versionRange goals goaladd-source/goal goalcompile/goal goaltestCompile/goal /goals /pluginExecutionFilter action ignore/ignore /action /pluginExecution pluginExecution pluginExecutionFilter groupIdde.saumya.mojo/groupId artifactId jruby-maven-plugin /artifactId versionRange [0.29.1,) /versionRange goals goalcompile/goal /goals /pluginExecutionFilter action ignore/ignore /action /pluginExecution /pluginExecutions /lifecycleMappingMetadata On Tue, Apr 29, 2014 at 12:59 PM, Hans Schwäbli bugs.need.love@gmail.com mailto:bugs.need.love@gmail.com wrote: Maybe Eclipse 4.4 has this feature, I haven't discovered it in 4.3. I created a lifecycle mappings metadata which solves this problem (such things could be added to a Wiki for instance): ?xml version=1.0 encoding=UTF-8? lifecycleMappingMetadata !-- Why this is needed for Eclipe:
Re: [jbehave-user] How to get working JBehave sources in Eclipse?
Hello Gavião, maybe I didn't spend enough time to discover why it did not work after I found a solution. It had a lot of compile errors if I don't pre-build it outside Eclipse before importing it. I don't know if copying the settings.xml to the .m2 folder would fix the problem. I can put settings.xml anywhere with Eclipse as long as I tell Eclipse where that file is. I will try that experimental feature next time. I now upgraded m2e from 1.4 to 1.5. On Tue, Apr 29, 2014 at 4:21 PM, Cristiano Gavião cvgav...@gmail.comwrote: On 29-04-2014 10:29, Hans Schwäbli wrote: It is a bit more tricky than I thought to get that sources working in Eclipse. First I have to check jbehave-core out. But then I don't must import it into Eclipse. First I have to configure the settings.xml with the company proxy settings I need and build everything with: mvn -s settings.xml clean install -Dmaven.test.skip=true why don't you just copy the profiles/repositories specified in the provided settings.xml to your ~user/.m2/settings.xml? If I don't do this but import the projects into Eclipse, then JBehave dependencies are downloaded from the maven repository instead of using the checked out ones. Jbehave snapshots jars are not being deployed into any remote repository (at least not that I know) so I think this is not true. m2e will get those dependencies from your local repository only if they aren't imported in the eclipse workspace... Then I need to configure Eclipse so that it uses the Maven lifecycleMappingMetadata. Below I updated it for the maven-dependency-plugin exclusion (see below). version 1.5 of m2e ( http://download.eclipse.org/technology/m2e/milestones/1.5 ) has the feature that Mauro have said... it is just a matter of choose the option and you don't need to deal with POM changes... In Eclipse I must use the settings.xml file from JBehave. Now I finally can import the projects into Eclipse (as Maven projects). After it builds I have just one compile error: JRubySteps cannot be resolved to a type. I can ignore that (delete the JRuby example project). There are quite some pitfalls, at least for my brain. ?xml version=1.0 encoding=UTF-8? lifecycleMappingMetadata !-- Why this is needed for Eclipe: http://wiki.eclipse.org/M2E_plugin_execution_not_covered -- pluginExecutions pluginExecution pluginExecutionFilter groupIdorg.apache.maven.plugins/groupId artifactIdmaven-dependency-plugin/artifactId versionRange[1.0.0,)/versionRange goals goalcopy-dependencies/goal goalunpack/goal /goals /pluginExecutionFilter action ignore / /action /pluginExecution pluginExecution pluginExecutionFilter groupIdorg.jbehave/groupId artifactId jbehave-maven-plugin /artifactId versionRange [3.10-SNAPSHOT,) /versionRange goals goal unpack-view-resources /goal /goals /pluginExecutionFilter action ignore/ignore /action /pluginExecution pluginExecution pluginExecutionFilter groupId org.jvnet.hudson.tools /groupId artifactId maven-hpi-plugin /artifactId versionRange [3.0.1,) /versionRange goals goalinsert-test/goal goaltest-hpl/goal goal resolve-test-dependencies /goal /goals /pluginExecutionFilter action ignore/ignore /action /pluginExecution pluginExecution pluginExecutionFilter groupIdorg.scala-tools/groupId artifactId maven-scala-plugin /artifactId versionRange [2.9.1,) /versionRange goals goaladd-source/goal goalcompile/goal goaltestCompile/goal /goals /pluginExecutionFilter action ignore/ignore /action /pluginExecution pluginExecution pluginExecutionFilter groupIdde.saumya.mojo/groupId artifactId jruby-maven-plugin /artifactId versionRange
Re: [jbehave-user] How to get working JBehave sources in Eclipse?
Thank you. I forgot about the page which explains the JBehave source building. So I didn't see that I need to use that settings.xml file. But I think my biggest mistake was when importing the maven project into Eclipse. The import wizard shows me the plugins which can't be found. There I can choose in a little dropdown that m2e writes into the pom.xml that these plugins are ignored. It works now with that approach. However, you could add these settings into the pom.xml parent file, so it would be no problem to import the maven projects into Eclipse. But I am afraid that you want to be IDE neutral. In that case a documentation on how to import JBehave sources into Eclipse would be nice. I would be willing to contribute if you provide some Wiki for JBehave (because I cannot commit anything in Github from the company and it is too much overhead to create HTML pages for me). On Fri, Apr 25, 2014 at 4:49 PM, Cristiano Gavião cvgav...@gmail.comwrote: first things you must learn before are: - how works a maven settings.xml and how to set it in your machine; - how m2e works related to a pure maven outside eclipse... - how to make m2e ignore unsupported plugins... here you have tips how to build outside eclipse: http://jbehave.org/reference/latest/building-source.html for the rest, I'm sure you will find lot of materials on the net... Cristiano On 25-04-2014 10:34, Hans Schwäbli wrote: I try to import the projects of jbehave-core (branch 4.x) into Eclipse Kepler as Maven projects. It causes a lot of problems: 127 errors (compile and pom problems). For example the error in jbehave-core\examples\core\pom.xml is: Multiple annotations found at this line: - maven-dependency-plugin (goals copy-dependencies, unpack) is not supported by m2e. - Plugin execution not covered by lifecycle configuration: org.jbehave:jbehave-maven-plugin:4.0-SNAPSHOT:unpack-view-resources (execution: unpack-view-resources, phase: process- resources) And for many other poms: Could not find artifact org.jbehave:jbehave-maven- plugin:pom:4.0-SNAPSHOT And: Project build error: Unknown packaging: hpi And if I build jbehave-core with maven (clean install without tests), then It fails with this error quite early at JBehave Hudson Plugin: [ERROR] Failed to execute goal org.kohsuke:access-modifier-checker:1.4:enforce (default-enforce) on project jbehave-hudson-plugin: Execution default-enforce of goal org.kohsuke:access-modifier-checker:1.4:enforce failed: Plugin org.kohsuke:access-modifier-checker:1.4 or one of its dependencies could not be resolved: Could not find artifact org.jenkins-ci:annotation-indexer:jar:1.4 in Central ( http://repo1.maven.org/maven2) - [Help 1] What is the problem? Or how do you get working projects of it in Eclipse after cloning it from Github? - To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
Re: [jbehave-user] How to get working JBehave sources in Eclipse?
Yes, the m2e plugin is very annoying in this. IMO it's one of the worst design decisions they've made when migrating from the original m2eclipse plugin. But with recent versions, Eclipse allows you to mark as ignored these errors without modifying the pom.xml. The feature is marked as experimental but it's stable and works fine. It stores the info to be ignored in the workspace (I'm not sure if it can exported and re-imported easily though). This is why the source code is not polluted with the pom.xml modifications - as you say to preserve IDE neutrality. On 28/04/2014 14:46, Hans Schwäbli wrote: Thank you. I forgot about the page which explains the JBehave source building. So I didn't see that I need to use that settings.xml file. But I think my biggest mistake was when importing the maven project into Eclipse. The import wizard shows me the plugins which can't be found. There I can choose in a little dropdown that m2e writes into the pom.xml that these plugins are ignored. It works now with that approach. However, you could add these settings into the pom.xml parent file, so it would be no problem to import the maven projects into Eclipse. But I am afraid that you want to be IDE neutral. In that case a documentation on how to import JBehave sources into Eclipse would be nice. I would be willing to contribute if you provide some Wiki for JBehave (because I cannot commit anything in Github from the company and it is too much overhead to create HTML pages for me). On Fri, Apr 25, 2014 at 4:49 PM, Cristiano Gavião cvgav...@gmail.com mailto:cvgav...@gmail.com wrote: first things you must learn before are: - how works a maven settings.xml and how to set it in your machine; - how m2e works related to a pure maven outside eclipse... - how to make m2e ignore unsupported plugins... here you have tips how to build outside eclipse: http://jbehave.org/reference/latest/building-source.html for the rest, I'm sure you will find lot of materials on the net... Cristiano On 25-04-2014 10 tel:25-04-2014%2010:34, Hans Schwäbli wrote: I try to import the projects of jbehave-core (branch 4.x) into Eclipse Kepler as Maven projects. It causes a lot of problems: 127 errors (compile and pom problems). For example the error in jbehave-core\examples\core\pom.xml is: Multiple annotations found at this line: - maven-dependency-plugin (goals copy-dependencies, unpack) is not supported by m2e. - Plugin execution not covered by lifecycle configuration: org.jbehave:jbehave-maven-plugin:4.0-SNAPSHOT:unpack-view-resources (execution: unpack-view-resources, phase: process- resources) And for many other poms: Could not find artifact org.jbehave:jbehave-maven-plugin:pom:4.0-SNAPSHOT And: Project build error: Unknown packaging: hpi And if I build jbehave-core with maven (clean install without tests), then It fails with this error quite early at JBehave Hudson Plugin: [ERROR] Failed to execute goal org.kohsuke:access-modifier-checker:1.4:enforce (default-enforce) on project jbehave-hudson-plugin: Execution default-enforce of goal org.kohsuke:access-modifier-checker:1.4:enforce failed: Plugin org.kohsuke:access-modifier-checker:1.4 or one of its dependencies could not be resolved: Could not find artifact org.jenkins-ci:annotation-indexer:jar:1.4 in Central (http://repo1.maven.org/maven2) - [Help 1] What is the problem? Or how do you get working projects of it in Eclipse after cloning it from Github? - To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email