[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [m2e-dev] webresource filtering with wtp
|
Thanks Fred. I had previously deleted all the projects from eclipse,
deleted .project, .classpath, and .settings, and re-imported them, and
they still weren't working. When I did "update project
configuration", it started working. I looked into it a bit further,
and it looks like the project isn't being configured correctly when
it's imported, but is being configured properly when explicitly told
to update the configuration.
The .settings/org.eclipse.wst.common.component after a fresh import:
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="war-with-filtered-resources">
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
<property name="context-root" value="war-with-filtered-resources"/>
<property name="java-output-path"
value="/war-with-filtered-resources/target/classes"/>
</wb-module>
</project-modules>
And after "update project configuration":
<?xml version="1.0" encoding="UTF-8"?>
<project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="war-with-filtered-resources">
<wb-resource deploy-path="/"
source-path="/target/m2eclipse-wtp/webresources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
<property name="context-root" value="war-with-filtered-resources"/>
<property name="java-output-path"
value="/war-with-filtered-resources/target/classes"/>
</wb-module>
</project-modules>
It doesn't seem to matter if "target/m2eclipse-wtp/webresources"
exists or not at the time of import, it doesn't show up as a
wb-resource until I "update project configuration". I've attached the
small sample project I tested this with.
On 24 March 2011 15:12, Fred Bricon <fbricon@xxxxxxxxx> wrote:
> If you just added this config to the war plugin, you need to make sure the
> maven configuration is updated (right click on project > maven > update
> project configuration)
>
> You should see a couple things happening :
> * the Web Resources node in the project explorer should contain a new child
> : webresources, containing all the filtered resources :
> http://img848.imageshack.us/f/resourcefiltering.jpg/
> * if you open the web project/.settings/ you should see the webresources
> folder is deployed before src/main/webapp :
> <?xml version="1.0" encoding="UTF-8"?>
> <project-modules id="moduleCoreId" project-version="1.5.0">
> <wb-module deploy-name="webapp">
> <wb-resource deploy-path="/WEB-INF/classes"
> source-path="/src/main/java"/>
> <wb-resource deploy-path="/"
> source-path="/target/m2eclipse-wtp/webresources"/>
> <wb-resource deploy-path="/" source-path="/src/main/webapp"/>
> <property name="context-root" value="webapp"/>
> <property name="java-output-path" value="/webapp/target/classes"/>
> </wb-module>
> </project-modules>
>
> Filtering is triggered on workspace modifications.
> You can try to clean the project or make a modification to one of the files
> to be filtered and see if the filtered folder is updated.
>
> If you can't make it work, please attach a sample project and steps to
> reproduce the issue to https://issues.sonatype.org/browse/MECLIPSEWTP-22
>
> regards,
>
> Fred Bricon
>
> 2011/3/24 Derek Lewis <derek@xxxxxxxxxx>
>>
>> Is this the right place to be posting about the m2eclipse-wtp plugin?
>>
>> I notice there was a post back on Jan 26th about a fix for webresource
>> filtering with m2eclipse-wtp:
>> http://dev.eclipse.org/mhonarc/lists/m2e-dev/msg00204.html Has this
>> been pushed out to the 0.13.x branch? I'm trying to get that working
>> with the latest m2e nightly and a m2e-wtp 0.13.x build from yesterday,
>> but while it's working with maven on the command line, in Eclipse with
>> wtp it's not filtering the webresource files. Is there additional
>> configuration required in the pom to get the m2e-wtp plugin to do the
>> filtering?
>>
>> My pom.xml has the following:
>> <plugin>
>> <groupId>org.apache.maven.plugins</groupId>
>> <artifactId>maven-war-plugin</artifactId>
>> <configuration>
>> <webResources>
>> <resource>
>> <filtering>true</filtering>
>> <directory>src/main/webapp</directory>
>> </resource>
>> </webResources>
>> </configuration>
>> </plugin>
>> Which is copying src/main/webapp/META-INF/context.xml.
>> _______________________________________________
>> m2e-dev mailing list
>> m2e-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/m2e-dev
>
>
>
> --
> "Have you tried turning it off and on again" - The IT Crowd
>
Attachment:
war-with-filtered-resources.zip
Description: Zip archive