[mevenide-dev] [jira] Issue Comment Edited: (MEVENIDE-607) Filtering sources does not trigger when running web application from NetBeans using Run command

"Milos Kleint (JIRA)" <jira-yCVjj/[email protected]>
Newsgroups gmane.comp.jakarta.turbine.maven.mevenide.devel
Message-ID <7650276.1205407288768.JavaMail.haus-jira@codehaus01.managed.contegix.com>
    [ http://jira.codehaus.org/browse/MEVENIDE-607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_127068 ] 

mkleint edited comment on MEVENIDE-607 at 3/13/08 6:19 AM:
----------------------------------------------------------------

the <resources> element didn't make the filtered webpages to appear in the resulting war file, nor in the expanded webapp under target/someName.
that's a wrong approach to filtering as far as I can tell. Your filtered content ends up in the web-inf/classes folder which is most probably not what you want. 
the correct filtering configuration is this:

{code:xml}
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.0.2</version>
                <configuration>
                    <webResources>
                        <webResource>
                            <directory>${basedir}/src/main/webapp</directory>
                            <filtering>true</filtering>
                        </webResource>                        
                    </webResources>
                </configuration>
            </plugin>
        </plugins>
{code}


then the expanded web app and the war file both get the correct filtered jsp files..

Please note that when editing deployed application's jsp files (deployed through netbeans) the filtering will not be applied as the IDE just copies the edited file as is, without filtering.. 



      was (Author: mkleint):
    the <resources> element didn't make the filtered webpages to appear in the resulting war file, nor in the expanded webapp under target/someName.
that's a wrong approach to filtering as far as I can tell. Your filtered content ends up in the web-inf/classes folder which is most probably not what you want. 
the correct filtering configuration is this:

{code:xml}
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.0.2</version>
                <configuration>
                    <webResources>
                        <webResource>
                            <directory>${basedir}/src/main/webapp</directory>
                            <filtering>true</filtering>
                        </webResource>                        
                    </webResources>
                </configuration>
            </plugin>
        </plugins>
{code:xml}


then the expanded web app and the war file both get the correct filtered jsp files..

Please note that when editing deployed application's jsp files (deployed through netbeans) the filtering will not be applied as the IDE just copies the edited file as is, without filtering.. 


  
> Filtering sources does not trigger when running web application from NetBeans using Run command
> -----------------------------------------------------------------------------------------------
>
>                 Key: MEVENIDE-607
>                 URL: http://jira.codehaus.org/browse/MEVENIDE-607
>             Project: mevenide
>          Issue Type: Bug
>          Components: mevenide2-netbeans
>    Affects Versions: NB_3.0
>         Environment: NetBeans 6.0, Maven plugin 3.0.9
>            Reporter: Grzegorz Borkowski
>            Assignee: Milos Kleint
>             Fix For: NB_3.1
>
>
> I have web project under Maven (packaging: war).
> I turned on filtering of web pages in Maven, so that maven substitutes ${pom.version} value during build. 
> The section in pom.xml looks like:
> <build>
>         <finalName>someName</finalName>
>         <resources>
>             <resource>
>                 <directory>src/main/webapp</directory>
>                 <filtering>true</filtering>
>             </resource>
>         </resources>
>     </build>
> This works well if I use "build" command: under target/classes I get web pages with project version substituted (filtering works).
> But when I call "Run" from NetBeans, it creates second directory under target/, and stores all web pages there, and they are used for running application on server. But those pages are not filtered.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.