Quantcast

Created: (MRESOURCES-144) if filter file does not exist it should optionally ignore it, not just throw an exception

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Created: (MRESOURCES-144) if filter file does not exist it should optionally ignore it, not just throw an exception

JIRA jira@codehaus.org
if filter file does not exist it should optionally ignore it, not just throw an exception
-----------------------------------------------------------------------------------------

                 Key: MRESOURCES-144
                 URL: http://jira.codehaus.org/browse/MRESOURCES-144
             Project: Maven 2.x Resources Plugin
          Issue Type: Improvement
    Affects Versions: 2.4.3
            Reporter: richard stevenson
            Priority: Minor


If you have a list of filter files

<filters>
  <filter>a.properties</filter>
  <filter>b.properties</filter>
  <filter>${prop.name}.properties</filter>
</filters>

It would be nice to tell the resources plugin to optioanlly ignore a file if it does not exist. Currently get the following stack trace:



org.apache.maven.lifecycle.LifecycleExecutionException: Error loading property f
ile 'D:\projects\.../src/main/filters/a.filter.properties'
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:719)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:556)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:535)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:387)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:348)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:180)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:6
0)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error loading propert
y file 'D:\projects\.../src/main/filters/a.filter.properties'
        at org.apache.maven.plugin.resources.ResourcesMojo.execute(ResourcesMojo
.java:269)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:490)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:694)
        ... 17 more
Caused by: org.apache.maven.shared.filtering.MavenFilteringException: Error load
ing property file 'D:\projects\.../src/main/filters/a.properties'
        at org.apache.maven.shared.filtering.DefaultMavenFileFilter.loadProperti
es(DefaultMavenFileFilter.java:274)
        at org.apache.maven.shared.filtering.DefaultMavenFileFilter.getDefaultFi
lterWrappers(DefaultMavenFileFilter.java:199)
        at org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.filt
erResources(DefaultMavenResourcesFiltering.java:162)
        at org.apache.maven.plugin.resources.ResourcesMojo.execute(ResourcesMojo
.java:265)
        ... 19 more
Caused by: java.io.FileNotFoundException: D:\projects\.../src/main/filters/a.fil
ter.properties
        at org.apache.maven.shared.filtering.PropertyUtils.loadPropertyFile(Prop
ertyUtils.java:65)
        at org.apache.maven.shared.filtering.DefaultMavenFileFilter.loadProperti
es(DefaultMavenFileFilter.java:269)
        ... 22 more

--
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

       
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

(MRESOURCES-144) if filter file does not exist it should optionally ignore it, not just throw an exception

JIRA jira@codehaus.org

     [ https://jira.codehaus.org/browse/MRESOURCES-144?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Suresh Avadhanula updated MRESOURCES-144:
-----------------------------------------

    Attachment: maven-filter.patch

Warns about missing property file. Throws exception if and only if all of the property files are missing
               

> if filter file does not exist it should optionally ignore it, not just throw an exception
> -----------------------------------------------------------------------------------------
>
>                 Key: MRESOURCES-144
>                 URL: https://jira.codehaus.org/browse/MRESOURCES-144
>             Project: Maven 2.x Resources Plugin
>          Issue Type: Improvement
>    Affects Versions: 2.4.3
>            Reporter: richard stevenson
>            Assignee: Olivier Lamy
>            Priority: Minor
>         Attachments: maven-filter.patch
>
>
> If you have a list of filter files
> <filters>
>   <filter>a.properties</filter>
>   <filter>b.properties</filter>
>   <filter>${prop.name}.properties</filter>
> </filters>
> It would be nice to tell the resources plugin to optioanlly ignore a file if it does not exist. Currently get the following stack trace:
> org.apache.maven.lifecycle.LifecycleExecutionException: Error loading property f
> ile 'D:\projects\.../src/main/filters/a.filter.properties'
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
> ultLifecycleExecutor.java:719)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
> fecycle(DefaultLifecycleExecutor.java:556)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
> ltLifecycleExecutor.java:535)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
> dleFailures(DefaultLifecycleExecutor.java:387)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
> ts(DefaultLifecycleExecutor.java:348)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
> fecycleExecutor.java:180)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
>         at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:6
> 0)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Error loading propert
> y file 'D:\projects\.../src/main/filters/a.filter.properties'
>         at org.apache.maven.plugin.resources.ResourcesMojo.execute(ResourcesMojo
> .java:269)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
> nManager.java:490)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
> ultLifecycleExecutor.java:694)
>         ... 17 more
> Caused by: org.apache.maven.shared.filtering.MavenFilteringException: Error load
> ing property file 'D:\projects\.../src/main/filters/a.properties'
>         at org.apache.maven.shared.filtering.DefaultMavenFileFilter.loadProperti
> es(DefaultMavenFileFilter.java:274)
>         at org.apache.maven.shared.filtering.DefaultMavenFileFilter.getDefaultFi
> lterWrappers(DefaultMavenFileFilter.java:199)
>         at org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.filt
> erResources(DefaultMavenResourcesFiltering.java:162)
>         at org.apache.maven.plugin.resources.ResourcesMojo.execute(ResourcesMojo
> .java:265)
>         ... 19 more
> Caused by: java.io.FileNotFoundException: D:\projects\.../src/main/filters/a.fil
> ter.properties
>         at org.apache.maven.shared.filtering.PropertyUtils.loadPropertyFile(Prop
> ertyUtils.java:65)
>         at org.apache.maven.shared.filtering.DefaultMavenFileFilter.loadProperti
> es(DefaultMavenFileFilter.java:269)
>         ... 22 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

(MRESOURCES-144) if filter file does not exist it should optionally ignore it, not just throw an exception

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org

    [ https://jira.codehaus.org/browse/MRESOURCES-144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=289560#comment-289560 ]

Suresh Avadhanula commented on MRESOURCES-144:
----------------------------------------------

By default maven-filtering-1.0-beta4 seems to pulled by maven resources plugin. I have maven 3.0.3.

I applied the patch to maven-filtering module. Update the pom to use the right version of the filtering module.

                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-resources-plugin</artifactId>
                            <version>2.5</version>
                            <dependencies>
                                <dependency>
                                    <groupId>org.apache.maven.shared</groupId>
                                    <artifactId>maven-filtering</artifactId>
                                    <version>1.0</version>
                                </dependency>
                            </dependencies>
                            <executions>
                                <execution>
                                    <phase>generate-resources</phase>
                                    <goals>
                                        <goal>resources</goal>
                                    </goals>
                                </execution>
                            </executions>
                        </plugin>
                    </plugins>
                </pluginManagement>
               

> if filter file does not exist it should optionally ignore it, not just throw an exception
> -----------------------------------------------------------------------------------------
>
>                 Key: MRESOURCES-144
>                 URL: https://jira.codehaus.org/browse/MRESOURCES-144
>             Project: Maven 2.x Resources Plugin
>          Issue Type: Improvement
>    Affects Versions: 2.4.3
>            Reporter: richard stevenson
>            Assignee: Olivier Lamy
>            Priority: Minor
>         Attachments: maven-filter.patch
>
>
> If you have a list of filter files
> <filters>
>   <filter>a.properties</filter>
>   <filter>b.properties</filter>
>   <filter>${prop.name}.properties</filter>
> </filters>
> It would be nice to tell the resources plugin to optioanlly ignore a file if it does not exist. Currently get the following stack trace:
> org.apache.maven.lifecycle.LifecycleExecutionException: Error loading property f
> ile 'D:\projects\.../src/main/filters/a.filter.properties'
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
> ultLifecycleExecutor.java:719)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
> fecycle(DefaultLifecycleExecutor.java:556)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
> ltLifecycleExecutor.java:535)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
> dleFailures(DefaultLifecycleExecutor.java:387)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
> ts(DefaultLifecycleExecutor.java:348)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
> fecycleExecutor.java:180)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
>         at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:6
> 0)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Error loading propert
> y file 'D:\projects\.../src/main/filters/a.filter.properties'
>         at org.apache.maven.plugin.resources.ResourcesMojo.execute(ResourcesMojo
> .java:269)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
> nManager.java:490)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
> ultLifecycleExecutor.java:694)
>         ... 17 more
> Caused by: org.apache.maven.shared.filtering.MavenFilteringException: Error load
> ing property file 'D:\projects\.../src/main/filters/a.properties'
>         at org.apache.maven.shared.filtering.DefaultMavenFileFilter.loadProperti
> es(DefaultMavenFileFilter.java:274)
>         at org.apache.maven.shared.filtering.DefaultMavenFileFilter.getDefaultFi
> lterWrappers(DefaultMavenFileFilter.java:199)
>         at org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.filt
> erResources(DefaultMavenResourcesFiltering.java:162)
>         at org.apache.maven.plugin.resources.ResourcesMojo.execute(ResourcesMojo
> .java:265)
>         ... 19 more
> Caused by: java.io.FileNotFoundException: D:\projects\.../src/main/filters/a.fil
> ter.properties
>         at org.apache.maven.shared.filtering.PropertyUtils.loadPropertyFile(Prop
> ertyUtils.java:65)
>         at org.apache.maven.shared.filtering.DefaultMavenFileFilter.loadProperti
> es(DefaultMavenFileFilter.java:269)
>         ... 22 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

(MRESOURCES-144) if filter file does not exist it should optionally ignore it, not just throw an exception

JIRA jira@codehaus.org
In reply to this post by JIRA jira@codehaus.org

    [ https://jira.codehaus.org/browse/MRESOURCES-144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=296727#comment-296727 ]

Dmitry Katsubo commented on MRESOURCES-144:
-------------------------------------------

Suresh, maven-filtering v1.0 that you refer dates to 2011. Does it include the patch (created in Jan 2012)?
Also it would be nice to have an option to disable exception at all (just print warnings), as in my case I have one property file which I would like to ignore...
               

> if filter file does not exist it should optionally ignore it, not just throw an exception
> -----------------------------------------------------------------------------------------
>
>                 Key: MRESOURCES-144
>                 URL: https://jira.codehaus.org/browse/MRESOURCES-144
>             Project: Maven 2.x Resources Plugin
>          Issue Type: Improvement
>    Affects Versions: 2.4.3
>            Reporter: richard stevenson
>            Assignee: Olivier Lamy
>            Priority: Minor
>         Attachments: maven-filter.patch
>
>
> If you have a list of filter files
> <filters>
>   <filter>a.properties</filter>
>   <filter>b.properties</filter>
>   <filter>${prop.name}.properties</filter>
> </filters>
> It would be nice to tell the resources plugin to optioanlly ignore a file if it does not exist. Currently get the following stack trace:
> org.apache.maven.lifecycle.LifecycleExecutionException: Error loading property f
> ile 'D:\projects\.../src/main/filters/a.filter.properties'
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
> ultLifecycleExecutor.java:719)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
> fecycle(DefaultLifecycleExecutor.java:556)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
> ltLifecycleExecutor.java:535)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
> dleFailures(DefaultLifecycleExecutor.java:387)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
> ts(DefaultLifecycleExecutor.java:348)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
> fecycleExecutor.java:180)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
>         at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:6
> 0)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
> java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
> sorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoExecutionException: Error loading propert
> y file 'D:\projects\.../src/main/filters/a.filter.properties'
>         at org.apache.maven.plugin.resources.ResourcesMojo.execute(ResourcesMojo
> .java:269)
>         at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
> nManager.java:490)
>         at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
> ultLifecycleExecutor.java:694)
>         ... 17 more
> Caused by: org.apache.maven.shared.filtering.MavenFilteringException: Error load
> ing property file 'D:\projects\.../src/main/filters/a.properties'
>         at org.apache.maven.shared.filtering.DefaultMavenFileFilter.loadProperti
> es(DefaultMavenFileFilter.java:274)
>         at org.apache.maven.shared.filtering.DefaultMavenFileFilter.getDefaultFi
> lterWrappers(DefaultMavenFileFilter.java:199)
>         at org.apache.maven.shared.filtering.DefaultMavenResourcesFiltering.filt
> erResources(DefaultMavenResourcesFiltering.java:162)
>         at org.apache.maven.plugin.resources.ResourcesMojo.execute(ResourcesMojo
> .java:265)
>         ... 19 more
> Caused by: java.io.FileNotFoundException: D:\projects\.../src/main/filters/a.fil
> ter.properties
>         at org.apache.maven.shared.filtering.PropertyUtils.loadPropertyFile(Prop
> ertyUtils.java:65)
>         at org.apache.maven.shared.filtering.DefaultMavenFileFilter.loadProperti
> es(DefaultMavenFileFilter.java:269)
>         ... 22 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
Loading...