tag:blogger.com,1999:blog-4457781382344670969.post1418373013705022442..comments2023-10-31T06:52:51.638-06:00Comments on Chris Maki's Blog: Getting Maven and Eclipse to work together to filter resourcesChris Makihttp://www.blogger.com/profile/16510702653624658586noreply@blogger.comBlogger13125tag:blogger.com,1999:blog-4457781382344670969.post-14329267345356906952010-11-24T03:22:47.904-07:002010-11-24T03:22:47.904-07:00The previous post by Anonymous is good, but there ...The previous post by Anonymous is good, but there is still some dependency on project name. Here's a plugin config that is really independent of project name and can be copied to other POM's as-is:<br /><br /><br /><plugin><br /> <artifactId>maven-eclipse-plugin</artifactId><br /> <configuration><br /> <additionalBuildcommands><br /> <buildCommand><br /> <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name><br /> <triggers>auto,full,incremental,</triggers><br /> <arguments><br /> <LaunchConfigHandle>&lt;project&gt;/.externalToolBuilders/mvn-resources.launch</LaunchConfigHandle><br /> </arguments><br /> </buildCommand><br /> </additionalBuildcommands><br /> <additionalConfig><br /> <file><br /> <name>.externalToolBuilders/mvn-resources.launch</name><br /> <content><br /> <![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="no"?><br /> <launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType"><br /> <booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="true"/><br /> <booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="true"/><br /> <stringAttribute key="org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE" value="&#36;{working_set:&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&#13;&#10;&lt;launchConfigurationWorkingSet editPageId=&quot;org.eclipse.ui.resourceWorkingSetPage&quot; factoryID=&quot;org.eclipse.ui.internal.WorkingSetFactory&quot; label=&quot;workingSet&quot; name=&quot;workingSet&quot;&gt;&#13;&#10;&lt;item factoryID=&quot;org.eclipse.ui.internal.model.ResourceFactory&quot; path=&quot;/${project.artifactId}/src/main/resources&quot; type=&quot;2&quot;/&gt;&#13;&#10;&lt;/launchConfigurationWorkingSet&gt;}"/><br /> <stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="$${system_path:mvn.bat}"/><br /> <stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,"/><br /> <stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="resources:resources"/><br /> <booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/><br /> <stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="&#36;{workspace_loc:/${artifactId}}"/><br /> </launchConfiguration>]]><br /> </content><br /> </file><br /> </additionalConfig><br /> </configuration><br /> </plugin>rustynut1https://www.blogger.com/profile/05447262393541265566noreply@blogger.comtag:blogger.com,1999:blog-4457781382344670969.post-91131936277393921792010-04-14T05:52:24.988-06:002010-04-14T05:52:24.988-06:00A really great tip! The process-ressources goal wa...A really great tip! The process-ressources goal was indeed the only reason for me to install m2eclipse. But because it didn't work well with WST I had a lot of problems. <br />So please, don't you ever delete this blog entry, because I made a link to it in our developper FAQ.Carlo.LFhttps://www.blogger.com/profile/06782016462780800688noreply@blogger.comtag:blogger.com,1999:blog-4457781382344670969.post-58627018227624924742009-02-03T09:18:00.000-07:002009-02-03T09:18:00.000-07:00As pointed out on another blog it is a manual proc...As pointed out on another blog it is a manual process to configure the builder in eclipse, every developer in a team must do that themselves and then whenever you run mvn eclipse:eclipse the eclipse settings are lost.<BR/><BR/>However you can configure the eclipse plugin in the pom.xml to generate the necessary eclipse build configuration as follows:<BR/><BR/><plugins><BR/> ...<BR/> <plugin><BR/> <groupId>org.apache.maven.plugins</groupId><BR/> <artifactId>maven-eclipse-plugin</artifactId><BR/> <configuration><BR/> <additionalBuildcommands><BR/> <buildCommand><BR/> <name>org.ui.externaltools.ExternalToolBuilder</name><BR/> <triggers>auto,full,incremental,</triggers><BR/> <arguments><BR/> <LaunchConfigHandle>&lt;project&gt;/.mavenResources.launch</LaunchConfigHandle><BR/> </arguments><BR/> </buildCommand><BR/> </additionalBuildcommands><BR/> <additionalConfig><BR/> <file><BR/> <name>.mavenResources.launch</name><BR/> <content><BR/><![CDATA[<?xml version="1.0" encoding="UTF-8"?><BR/><launchConfiguration type="org.eclipse.ui.externaltools.ProgramBuilderLaunchConfigurationType"><BR/><booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/><BR/><stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${maven.home}/bin/mvn.bat"/><BR/><stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,"/><BR/><stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="resources:resources resources:testResources"/><BR/><booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/><BR/><stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="$${workspace_loc:/profitmaker-webapp}"/><BR/></launchConfiguration><BR/>]]><BR/> </content><BR/> </file><BR/> </additionalConfig><BR/> </configuration><BR/> </plugin><BR/> ...<BR/></plugins>Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4457781382344670969.post-23511627317579341162009-02-03T09:14:00.000-07:002009-02-03T09:14:00.000-07:00This comment has been removed by the author.Unknownhttps://www.blogger.com/profile/09353414587553252735noreply@blogger.comtag:blogger.com,1999:blog-4457781382344670969.post-38204746349064651092009-01-18T22:53:00.000-07:002009-01-18T22:53:00.000-07:00This comment has been removed by a blog administrator.wow power levelinghttps://www.blogger.com/profile/17740059839891957088noreply@blogger.comtag:blogger.com,1999:blog-4457781382344670969.post-53217208304817670652008-03-12T07:47:00.000-06:002008-03-12T07:47:00.000-06:00Hi mmueThe filter process I outlined in the post w...Hi mmue<BR/><BR/>The filter process I outlined in the post works for me, however, I've made a few changes to the way I use it at work. Specifically, I now use a Program Builder and not an m2eclipse builder (I only use Q4E now btw). I'll update the post in a second, but the you'll need to check all the options available on the Build Options tab, under "Run the builder:", this means the builder runs during and after a clean, that seems to make it all work correctly. Let me know if that fixes things for you.<BR/><BR/>ChrisChris Makihttps://www.blogger.com/profile/16510702653624658586noreply@blogger.comtag:blogger.com,1999:blog-4457781382344670969.post-68792581021176866152008-03-12T07:41:00.000-06:002008-03-12T07:41:00.000-06:00Hi felix röthenbacherI'm not sure if m2eclipse ca...Hi felix röthenbacher<BR/><BR/>I'm not sure if m2eclipse can do this but you might want to ask eugene kuleshov, he created the m2eclipse plugin.<BR/><BR/>ChrisChris Makihttps://www.blogger.com/profile/16510702653624658586noreply@blogger.comtag:blogger.com,1999:blog-4457781382344670969.post-79652507033792279422008-03-07T02:24:00.000-07:002008-03-07T02:24:00.000-07:00Great HowTo. Its really the solution to all my res...Great HowTo. Its really the solution to all my resources problems .... I thought. I realised that the Eclipse "just copy the resources" function is still in place and starts after I triggered the maven process resources.<BR/>The only two solutions I found are:<BR/>1. Exclude all files from the resources folder in the BuildPath configuration<BR/>or<BR/>2. Remove the resources folder completely as source folder<BR/><BR/>Both work but are not configurable from the maven-eclipse-plugin and therefore have to be configured manually for each project (in a larger project not acceptable).<BR/><BR/>I wonder what you found for a solution for this problem?mmuehttps://www.blogger.com/profile/03049651894650774834noreply@blogger.comtag:blogger.com,1999:blog-4457781382344670969.post-57343603282891610982007-12-02T10:25:00.000-07:002007-12-02T10:25:00.000-07:00Is it possible to use m2eclipse plugin to copy fil...Is it possible to use m2eclipse plugin to copy filtered resources to a server (i.e. publish)<BR/>with WTP?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4457781382344670969.post-82866965875192400352007-10-12T10:00:00.000-06:002007-10-12T10:00:00.000-06:00I'm looking forward to hearing more about what you...I'm looking forward to hearing more about what you have in mind. I'm switched to using the m2 builder for filtering but now every time I save a file, the builder kicks in and it's starting to really bug me :-)Chris Makihttps://www.blogger.com/profile/16510702653624658586noreply@blogger.comtag:blogger.com,1999:blog-4457781382344670969.post-66038476270329122862007-10-12T09:35:00.000-06:002007-10-12T09:35:00.000-06:00Actually I have an idea how to make it work withou...Actually I have an idea how to make it work without adding this external builder. Stay tuned. :-)Eugene Kuleshovhttps://www.blogger.com/profile/08736056465101896635noreply@blogger.comtag:blogger.com,1999:blog-4457781382344670969.post-28528923436515384122007-10-12T06:23:00.000-06:002007-10-12T06:23:00.000-06:00Hi EugeneThanks for the follow-up post. I just tr...Hi Eugene<BR/><BR/>Thanks for the follow-up post. I just tried it out and it works like a champ. I'll start using that when I use m2eclipse :-) BTW, is this something you could add to m2eclipse so folks don't have to manually do this for every project?<BR/><BR/>ChrisChris Makihttps://www.blogger.com/profile/16510702653624658586noreply@blogger.comtag:blogger.com,1999:blog-4457781382344670969.post-90335009382575786152007-10-11T15:47:00.000-06:002007-10-11T15:47:00.000-06:00We certainly do know how to configure this with m2...We <A HREF="http://www.jroller.com/eu/entry/maven_resource_filtering" REL="nofollow">certainly do know</A> how to configure this with m2eclipse. :-)Eugene Kuleshovhttps://www.blogger.com/profile/08736056465101896635noreply@blogger.com