You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Mike Calmus (JIRA)" <ji...@codehaus.org> on 2010/12/02 22:02:03 UTC

[jira] Created: (MWAR-244) Provide a mechanism for not including or having an empty webapp directory

Provide a mechanism for not including or having an empty webapp directory
-------------------------------------------------------------------------

                 Key: MWAR-244
                 URL: http://jira.codehaus.org/browse/MWAR-244
             Project: Maven 2.x WAR Plugin
          Issue Type: Improvement
    Affects Versions: 2.1.1
            Reporter: Mike Calmus
            Priority: Minor


If the configured (or default) webapp directory does not exist, the plugin throws an IllegalArgumentException saying the directory does not exist. There should be a way to proceed without having to create an empty directory.

[INFO] Trace
java.lang.IllegalStateException: basedir D:\mydir\src\main\webapp does not exist
        at org.codehaus.plexus.util.DirectoryScanner.scan(DirectoryScanner.java:290)
        at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.getFilesToCopy(WarProjectPackagingTask.java:373)
        at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.copyResources(WarProjectPackagingTask.java:317)
        at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.handleWebResources(WarProjectPackagingTask.java:135)
        at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.performPackaging(WarProjectPackagingTask.java:91)
        at org.apache.maven.plugin.war.AbstractWarMojo.buildWebapp(AbstractWarMojo.java:472)
        at org.apache.maven.plugin.war.AbstractWarMojo.buildExplodedWebapp(AbstractWarMojo.java:404)
        at org.apache.maven.plugin.war.WarMojo.performPackaging(WarMojo.java:197)
        at org.apache.maven.plugin.war.WarMojo.execute(WarMojo.java:159)
        ...

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

        

[jira] Commented: (MWAR-244) Provide a mechanism for not including or having an empty webapp directory

Posted by "Stephane Nicoll (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MWAR-244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=246620#action_246620 ] 

Stephane Nicoll commented on MWAR-244:
--------------------------------------

blame the parent pom then. You are explicitly asking the plugin to copy some resources. Taking it to other way around, folks would complain that the plugin does not report that a directory does not exist while it was specified.

You can override the definition using an empty webResources element maybe. All in all, the definition in the corporate pom seems fishy to me. Maybe you need to fix it there.

> Provide a mechanism for not including or having an empty webapp directory
> -------------------------------------------------------------------------
>
>                 Key: MWAR-244
>                 URL: http://jira.codehaus.org/browse/MWAR-244
>             Project: Maven 2.x WAR Plugin
>          Issue Type: Improvement
>    Affects Versions: 2.1.1
>            Reporter: Mike Calmus
>            Priority: Minor
>
> If the configured (or default) webapp directory does not exist, the plugin throws an IllegalArgumentException saying the directory does not exist. There should be a way to proceed without having to create an empty directory.
> [INFO] Trace
> java.lang.IllegalStateException: basedir D:\mydir\src\main\webapp does not exist
>         at org.codehaus.plexus.util.DirectoryScanner.scan(DirectoryScanner.java:290)
>         at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.getFilesToCopy(WarProjectPackagingTask.java:373)
>         at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.copyResources(WarProjectPackagingTask.java:317)
>         at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.handleWebResources(WarProjectPackagingTask.java:135)
>         at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.performPackaging(WarProjectPackagingTask.java:91)
>         at org.apache.maven.plugin.war.AbstractWarMojo.buildWebapp(AbstractWarMojo.java:472)
>         at org.apache.maven.plugin.war.AbstractWarMojo.buildExplodedWebapp(AbstractWarMojo.java:404)
>         at org.apache.maven.plugin.war.WarMojo.performPackaging(WarMojo.java:197)
>         at org.apache.maven.plugin.war.WarMojo.execute(WarMojo.java:159)
>         ...

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

        

[jira] Issue Comment Edited: (MWAR-244) Provide a mechanism for not including or having an empty webapp directory

Posted by "Stephane Nicoll (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MWAR-244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=246695#action_246695 ] 

Stephane Nicoll edited comment on MWAR-244 at 12/7/10 1:44 AM:
---------------------------------------------------------------

I don't think adding a "empty webResource element remove the crap from a parent pom" brings any value. I agree it might be useful in your case but this has no valid semantic. Just fix your parent pom. After all, if the parent states that some resources must be copied from directory foo (whatever the config is) then it means it's a corporate standard. If not, well the pom is wrong.

      was (Author: sni):
    I don't think adding a "empty webResource element equals remove the crap from a parent pom". I agree it might be useful in your case but this has no valid semantic. Just fix your parent pom. After all, if the parent states that some resources must be copied from directory foo (whatever the config is) then it means it's a corporate standard. If not, well the pom is wrong.
  
> Provide a mechanism for not including or having an empty webapp directory
> -------------------------------------------------------------------------
>
>                 Key: MWAR-244
>                 URL: http://jira.codehaus.org/browse/MWAR-244
>             Project: Maven 2.x WAR Plugin
>          Issue Type: Improvement
>    Affects Versions: 2.1.1
>            Reporter: Mike Calmus
>            Priority: Minor
>
> If the configured (or default) webapp directory does not exist, the plugin throws an IllegalArgumentException saying the directory does not exist. There should be a way to proceed without having to create an empty directory.
> [INFO] Trace
> java.lang.IllegalStateException: basedir D:\mydir\src\main\webapp does not exist
>         at org.codehaus.plexus.util.DirectoryScanner.scan(DirectoryScanner.java:290)
>         at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.getFilesToCopy(WarProjectPackagingTask.java:373)
>         at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.copyResources(WarProjectPackagingTask.java:317)
>         at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.handleWebResources(WarProjectPackagingTask.java:135)
>         at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.performPackaging(WarProjectPackagingTask.java:91)
>         at org.apache.maven.plugin.war.AbstractWarMojo.buildWebapp(AbstractWarMojo.java:472)
>         at org.apache.maven.plugin.war.AbstractWarMojo.buildExplodedWebapp(AbstractWarMojo.java:404)
>         at org.apache.maven.plugin.war.WarMojo.performPackaging(WarMojo.java:197)
>         at org.apache.maven.plugin.war.WarMojo.execute(WarMojo.java:159)
>         ...

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

        

[jira] Commented: (MWAR-244) Provide a mechanism for not including or having an empty webapp directory

Posted by "Mike Calmus (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MWAR-244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=246612#action_246612 ] 

Mike Calmus commented on MWAR-244:
----------------------------------

This is occurring because a webResources block is set up in a company-wide parent pom. The block points to a directory that doesn't exist in my implementation. There seems to be no way to override or remove this configuration inherited from a parent pom.

> Provide a mechanism for not including or having an empty webapp directory
> -------------------------------------------------------------------------
>
>                 Key: MWAR-244
>                 URL: http://jira.codehaus.org/browse/MWAR-244
>             Project: Maven 2.x WAR Plugin
>          Issue Type: Improvement
>    Affects Versions: 2.1.1
>            Reporter: Mike Calmus
>            Priority: Minor
>
> If the configured (or default) webapp directory does not exist, the plugin throws an IllegalArgumentException saying the directory does not exist. There should be a way to proceed without having to create an empty directory.
> [INFO] Trace
> java.lang.IllegalStateException: basedir D:\mydir\src\main\webapp does not exist
>         at org.codehaus.plexus.util.DirectoryScanner.scan(DirectoryScanner.java:290)
>         at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.getFilesToCopy(WarProjectPackagingTask.java:373)
>         at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.copyResources(WarProjectPackagingTask.java:317)
>         at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.handleWebResources(WarProjectPackagingTask.java:135)
>         at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.performPackaging(WarProjectPackagingTask.java:91)
>         at org.apache.maven.plugin.war.AbstractWarMojo.buildWebapp(AbstractWarMojo.java:472)
>         at org.apache.maven.plugin.war.AbstractWarMojo.buildExplodedWebapp(AbstractWarMojo.java:404)
>         at org.apache.maven.plugin.war.WarMojo.performPackaging(WarMojo.java:197)
>         at org.apache.maven.plugin.war.WarMojo.execute(WarMojo.java:159)
>         ...

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

        

[jira] Commented: (MWAR-244) Provide a mechanism for not including or having an empty webapp directory

Posted by "Stephane Nicoll (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MWAR-244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=246500#action_246500 ] 

Stephane Nicoll commented on MWAR-244:
--------------------------------------

Again, that sounds weird. It shouldn't be doing that except if you add webResources yourself (which you shouldn't have to do for a default use case). I just tried with a sample project with no webapp directory and it worked.

You are probably using a configuration item wrongly. Please attach a sample project.

> Provide a mechanism for not including or having an empty webapp directory
> -------------------------------------------------------------------------
>
>                 Key: MWAR-244
>                 URL: http://jira.codehaus.org/browse/MWAR-244
>             Project: Maven 2.x WAR Plugin
>          Issue Type: Improvement
>    Affects Versions: 2.1.1
>            Reporter: Mike Calmus
>            Priority: Minor
>
> If the configured (or default) webapp directory does not exist, the plugin throws an IllegalArgumentException saying the directory does not exist. There should be a way to proceed without having to create an empty directory.
> [INFO] Trace
> java.lang.IllegalStateException: basedir D:\mydir\src\main\webapp does not exist
>         at org.codehaus.plexus.util.DirectoryScanner.scan(DirectoryScanner.java:290)
>         at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.getFilesToCopy(WarProjectPackagingTask.java:373)
>         at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.copyResources(WarProjectPackagingTask.java:317)
>         at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.handleWebResources(WarProjectPackagingTask.java:135)
>         at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.performPackaging(WarProjectPackagingTask.java:91)
>         at org.apache.maven.plugin.war.AbstractWarMojo.buildWebapp(AbstractWarMojo.java:472)
>         at org.apache.maven.plugin.war.AbstractWarMojo.buildExplodedWebapp(AbstractWarMojo.java:404)
>         at org.apache.maven.plugin.war.WarMojo.performPackaging(WarMojo.java:197)
>         at org.apache.maven.plugin.war.WarMojo.execute(WarMojo.java:159)
>         ...

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

        

[jira] Closed: (MWAR-244) Provide a mechanism for not including or having an empty webapp directory

Posted by "Stephane Nicoll (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MWAR-244?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephane Nicoll closed MWAR-244.
--------------------------------

    Resolution: Won't Fix

I don't think adding a "empty webResource element equals remove the crap from a parent pom". I agree it might be useful in your case but this has no valid semantic. Just fix your parent pom. After all, if the parent states that some resources must be copied from directory foo (whatever the config is) then it means it's a corporate standard. If not, well the pom is wrong.

> Provide a mechanism for not including or having an empty webapp directory
> -------------------------------------------------------------------------
>
>                 Key: MWAR-244
>                 URL: http://jira.codehaus.org/browse/MWAR-244
>             Project: Maven 2.x WAR Plugin
>          Issue Type: Improvement
>    Affects Versions: 2.1.1
>            Reporter: Mike Calmus
>            Priority: Minor
>
> If the configured (or default) webapp directory does not exist, the plugin throws an IllegalArgumentException saying the directory does not exist. There should be a way to proceed without having to create an empty directory.
> [INFO] Trace
> java.lang.IllegalStateException: basedir D:\mydir\src\main\webapp does not exist
>         at org.codehaus.plexus.util.DirectoryScanner.scan(DirectoryScanner.java:290)
>         at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.getFilesToCopy(WarProjectPackagingTask.java:373)
>         at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.copyResources(WarProjectPackagingTask.java:317)
>         at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.handleWebResources(WarProjectPackagingTask.java:135)
>         at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.performPackaging(WarProjectPackagingTask.java:91)
>         at org.apache.maven.plugin.war.AbstractWarMojo.buildWebapp(AbstractWarMojo.java:472)
>         at org.apache.maven.plugin.war.AbstractWarMojo.buildExplodedWebapp(AbstractWarMojo.java:404)
>         at org.apache.maven.plugin.war.WarMojo.performPackaging(WarMojo.java:197)
>         at org.apache.maven.plugin.war.WarMojo.execute(WarMojo.java:159)
>         ...

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

        

[jira] Commented: (MWAR-244) Provide a mechanism for not including or having an empty webapp directory

Posted by "Mike Calmus (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MWAR-244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=246623#action_246623 ] 

Mike Calmus commented on MWAR-244:
----------------------------------

I do blame the parent pom.

However, an empty webResrouces block doesn't get rid of the settings. There seems no way to do so. Having one would be nice.

> Provide a mechanism for not including or having an empty webapp directory
> -------------------------------------------------------------------------
>
>                 Key: MWAR-244
>                 URL: http://jira.codehaus.org/browse/MWAR-244
>             Project: Maven 2.x WAR Plugin
>          Issue Type: Improvement
>    Affects Versions: 2.1.1
>            Reporter: Mike Calmus
>            Priority: Minor
>
> If the configured (or default) webapp directory does not exist, the plugin throws an IllegalArgumentException saying the directory does not exist. There should be a way to proceed without having to create an empty directory.
> [INFO] Trace
> java.lang.IllegalStateException: basedir D:\mydir\src\main\webapp does not exist
>         at org.codehaus.plexus.util.DirectoryScanner.scan(DirectoryScanner.java:290)
>         at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.getFilesToCopy(WarProjectPackagingTask.java:373)
>         at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.copyResources(WarProjectPackagingTask.java:317)
>         at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.handleWebResources(WarProjectPackagingTask.java:135)
>         at org.apache.maven.plugin.war.packaging.WarProjectPackagingTask.performPackaging(WarProjectPackagingTask.java:91)
>         at org.apache.maven.plugin.war.AbstractWarMojo.buildWebapp(AbstractWarMojo.java:472)
>         at org.apache.maven.plugin.war.AbstractWarMojo.buildExplodedWebapp(AbstractWarMojo.java:404)
>         at org.apache.maven.plugin.war.WarMojo.performPackaging(WarMojo.java:197)
>         at org.apache.maven.plugin.war.WarMojo.execute(WarMojo.java:159)
>         ...

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