Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Duplicate
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
The sysdeo-tomcat-plugin (mojo project) - for example - is usefull to configure sysdeo tomcat eclispe-plugin as an alternative to WTP.
It must run during the project import into eclipse (or after dependency changes in POMs)
m2eclipse should propose a custom additional goal editor to setup such goals to run during project checkout.
-
Hide
- test.zip
- 06/May/08 3:53 AM
- 8 kB
- nicolas de loof
-
- .classpath 0.3 kB
- .project 0.5 kB
- .settings/org.maven.ide.eclipse.prefs 0.2 kB
- one/.classpath 0.5 kB
- one/.project 0.5 kB
- one/.../org.maven.ide.eclipse.prefs 0.2 kB
- one/pom.xml 0.4 kB
- pom.xml 0.5 kB
- two/.classpath 0.5 kB
- two/.project 0.5 kB
- two/.../org.maven.ide.eclipse.prefs 0.2 kB
- two/.tomcatplugin 0.7 kB
- two/pom.xml 0.9 kB
- two/src/main/webapp/META-INF/context.xml 0.0 kB
- two/target/mvn-eclipse-cache.properties 0.1 kB
Issue Links
- duplicates
-
MNGECLIPSE-354
Select goals to run after selecting poms of projects to import
-
Activity
Maybe I'm wrong, but this requires to create a dedicated extension to m2eclipse as an eclipse plugin.
This requires me much efforts to port my favorite tool to m2eclipse : maven, eclipse and the tool itself ...
Actually, you are right, this is indeed different feature from extensible project import/configuration.
Nicolas, can you please attach a complete project with maven-eclipse-plugin and sysdeo-tomcat-maven-plugin configuration and some sample app that would allow us to test it?
http://www.eclipsetotale.com/tomcatPlugin.html
http://mojo.codehaus.org/sysdeo-tomcat-maven-plugin/
http://platina.svn.sf.net/svnroot/platina/trunk/platina-archetype/
This project is used to build a multi-module archetype 'from-project'
running mvn -P setup creates the required eclipse configuration, including the .tomcatPlugin in the war module.
Nicolas, project does not exist at that svn location and mvn build fail from the command line for the project I found in that svn tree. Can you please attach small project that woulld have this issue isolated and will allow us to reproduce this.
Also note that we added project import configurator for sysdeo Maven plugin, so your use case is probably already covered. we just need something to test that.
Sorry, I changed the SVN layout to http://platina.svn.sf.net/svnroot/platina/platina-archetype/trunk/.
build may fail as there is some non-public dependencies (oracle driver and others)
I'll test this configurator.
I've tested the configurator but it doesn't work well :
When generated from command line, the .tomcatPlugin contains M2_REPO references to the war project compile/runtime dependencies, and to other project modules target/classes
When generated via m2celipse, the .tomcatPlugin only refers to 1rst level module dependencies : If my webapp has dependency to "business", and transitively to "persistence", I only can setup sysdeo tomcat to use business/target/classes, not persistence/target/classes, as latest is not declared as a project dependency in my .project
None of the maven dependencies are checked in the sysdeo tomcat plugin pannel. The generated .tomcatPlugin contains the expected M2_REPO/* references, but I supposed they are ignored as not beeing in the project classpath. The m2eclipse classpath container does not distinct runtime and test scopes, so cannot be used here.
The sysdeo-tomcat plugin uses target/classes as binary folder. The m2eclipse uses target-eclipse/classes, so the folder is not included in the tomcat configuration (This may be a mojo bug). The option to set "use maven output folder" should be a global m2eclipse preference setting.
The resource folders are configured by m2eclipse to output in same source folder, not in target (is this a bug ?). Based on this no resource will be accessible in the tomcat configuration.
I can help fixing some issues on the Mojo side, but the m2eclipse classpath container is a blocking one.
I made some changes to the sysdeo mojo to support execution from m2eclipse. I'll create a dedicated goal sysdeo-tomcat:m2eclipse for this.
First, it generates dependency path in .tomcatPlugin with absolute path (in replacement for M2_REPO) that is accepted by the eclipse sysdeo plugin. This is not very clean but solves the classpath container issue.
I also copy/pasted code from the eclipse plugin to discover other projects available in the workspace. The plugin is expected to run in reactor to retrieve other modules. This configuration is more flexible, and works when ran in single module mode.
I use the .classpath to detect the output folder, when set by m2eclipse to "target-eclipse/classes.
I now still have an issue with the resource folder that is mapped to itself by m2eclipse, and not to the output folder.
Nicolas, you can set m2eclipse to use target folder by enabling "use maven output folder" flag in project import wizards and/or in Maven properties for given project. Anyways, there is very little we can do without test project.
About "issue with the resource folder that is mapped to itself". Generally this is by design. If this approach breaks some particular functionality, please open separate jira issue and provide test project and step by step instructions how to reproduce particular erroneous behavior.
Is there any system propery set by m2eclipse to expose the output directory to be used in the current project during configuration ?
I'll prepare a simplified test project to demonstrate the sysdeo-tomcat integration.
I've applied the required changes to the sysdeo-tomcat mojo and deployed a snapshot.
This requires to change the m2eclipse plugin.xml to use the sysdeo-tomcat:m2eclipse goal
<configurator id="org.maven.ide.eclipse.configurator.mavenSysdeoTomcatPlugin"
class="org.maven.ide.eclipse.project.configurator.MavenProjectConfigurator:org.codehaus.mojo:sysdeo-tomcat-maven-plugin| sysdeo-tomcat:m2eclipse"
name="sysdeo-tomcat-maven-plugin" priority="50"/>
The attached project can be used to test the integration. The sysdeo-tomcat eclipse plugin is expected to get configured : "is a tomcat project" checked, and "devloader" tab enabled with project dependencies and module "one" output directory.
<configurator id="org.maven.ide.eclipse.configurator.mavenSysdeoTomcatPlugin" class="org.maven.ide.eclipse.project.configurator.MavenProjectConfigurator:org.codehaus.mojo:sysdeo-tomcat-maven-plugin| sysdeo-tomcat:m2eclipse" name="sysdeo-tomcat-maven-plugin" priority="50"/>The attached project can be used to test the integration. The sysdeo-tomcat eclipse plugin is expected to get configured : "is a tomcat project" checked, and "devloader" tab enabled with project dependencies and module "one" output directory.
Nicolas, you lost me. Why did you have to change maven plugin and why there is something specific to m2eclipse is required?
Any update on this? Do we need to do anything in m2eclipse or this issue can be closed now? Thanks
Consolidating similar issues into one. Please comment on MNGECLIPSE-354
right,
I have to investigate more on mojo side to use m2eclipse layout.
regarding the orinigial issue, it would be nice to be able to plug any custom goal invocation without having to patch the m2eclipse code. Let's consider the new springide-maven-plugin at mojo. This could be packaged as a configuration contributor, but to use it now I need to patch m2eclipse. I'd like to have an option to specify a set of custom goals to run during project setup.
Nicolas,
Have a look at http://docs.codehaus.org/display/M2ECLIPSE/Extensible+project+import+and+configuration+framework. I think it should address your needs. Let me know if you run into problems or have ideas on how to improve this framework.