You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Victor Yushenko (JIRA)" <ji...@codehaus.org> on 2005/10/23 06:26:11 UTC

[jira] Created: (MNG-1288) war:exploded removes content of .class files

war:exploded removes content of .class files
--------------------------------------------

         Key: MNG-1288
         URL: http://jira.codehaus.org/browse/MNG-1288
     Project: Maven 2
        Type: Bug
  Components: maven-war-plugin  
 Environment:  WIndowx XP
 Reporter: Victor Yushenko


To enable development in MyEclipse I have been configuring maven to build a folder with 'war' extention during the build. This then becomes an expanded folder that I can just copy (actually MyEclipse does it) to jboss for deployment.
After the build my folder structure looks like this:
--src
    |-----main
...
--target
    |---testweb.war
            |---css
            |---WEB-INF
                   |---- classes
                   |---- lib
                   |---- jsp

I also configure compiler to compile files directy into target/${project.build.finalName}.war/WEB-INF/classes (which would be a target/testweb.war/WEB-INF/classes in the example above). This worked great in maven 1.* (I can change any file, eclipse compiles it into the class folder and MyEclipse immidiately deployes it to the JBoss). It also seemed to work for few hours in maven 2 (I only starrted using it today). Now if I do: "mvn package" I get proper exploded war except that all files in the 'classes' folder have 0 size. It seems that compiler creates good class files (and copies resources there) and then war plug-in comes along and wipes content of these files (but not files themselfs):
Here is a snipped from my pom.xml:
  <build>
    <finalName>testweb.war</finalName>
    <outputDirectory>target/${project.build.finalName}.war/WEB-INF/classes</outputDirectory>
    <directory>target/war</directory>

<plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <configuration>
                <webappDirectory>target/${project.build.finalName}.war</webappDirectory>
            </configuration>
         </plugin>
     </plugins>
  </build>

As an experimet I did following steps:
mvn compile - this produced expected results, compiled classes in the WEB-INF/classes folder

then I did:
mvn war:exploded - this command copied files from webapp and removed content from files produced by the compiler, so that all *.class files now have 0 bytes size...

Interestingly enough it seemed to work for few hours and then just stoped. I have rebooted PC just to see and I still get the same result...
my src\main\webapp\WEB-INF folder does not have classes folder, so I am not sure why war plug-in affects *.class files. 

P.S. I mistakenly created another issue for maven-war (which now I am guessing is only related to maven 1...). MPWAR-51

-- 
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, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Updated: (MNG-1288) war:exploded removes content of .class files

Posted by "Victor Yushenko (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-1288?page=all ]

Victor Yushenko updated MNG-1288:
---------------------------------

    Attachment: MNG-1288-maven-war-plugin.patch

This patch contains the fix for this issue.

> war:exploded removes content of .class files
> --------------------------------------------
>
>          Key: MNG-1288
>          URL: http://jira.codehaus.org/browse/MNG-1288
>      Project: Maven 2
>         Type: Bug
>   Components: maven-war-plugin
>  Environment:  WIndowx XP
>     Reporter: Victor Yushenko
>  Attachments: MNG-1288-maven-war-plugin.patch
>
>
> To enable development in MyEclipse I have been configuring maven to build a folder with 'war' extention during the build. This then becomes an expanded folder that I can just copy (actually MyEclipse does it) to jboss for deployment.
> After the build my folder structure looks like this:
> --src
>     |-----main
> ...
> --target
>     |---testweb.war
>             |---css
>             |---WEB-INF
>                    |---- classes
>                    |---- lib
>                    |---- jsp
> I also configure compiler to compile files directy into target/${project.build.finalName}.war/WEB-INF/classes (which would be a target/testweb.war/WEB-INF/classes in the example above). This worked great in maven 1.* (I can change any file, eclipse compiles it into the class folder and MyEclipse immidiately deployes it to the JBoss). It also seemed to work for few hours in maven 2 (I only starrted using it today). Now if I do: "mvn package" I get proper exploded war except that all files in the 'classes' folder have 0 size. It seems that compiler creates good class files (and copies resources there) and then war plug-in comes along and wipes content of these files (but not files themselfs):
> Here is a snipped from my pom.xml:
>   <build>
>     <finalName>testweb.war</finalName>
>     <outputDirectory>target/${project.build.finalName}.war/WEB-INF/classes</outputDirectory>
>     <directory>target/war</directory>
> <plugins>
>         <plugin>
>             <groupId>org.apache.maven.plugins</groupId>
>             <artifactId>maven-war-plugin</artifactId>
>             <configuration>
>                 <webappDirectory>target/${project.build.finalName}.war</webappDirectory>
>             </configuration>
>          </plugin>
>      </plugins>
>   </build>
> As an experimet I did following steps:
> mvn compile - this produced expected results, compiled classes in the WEB-INF/classes folder
> then I did:
> mvn war:exploded - this command copied files from webapp and removed content from files produced by the compiler, so that all *.class files now have 0 bytes size...
> Interestingly enough it seemed to work for few hours and then just stoped. I have rebooted PC just to see and I still get the same result...
> my src\main\webapp\WEB-INF folder does not have classes folder, so I am not sure why war plug-in affects *.class files. 
> P.S. I mistakenly created another issue for maven-war (which now I am guessing is only related to maven 1...). MPWAR-51

-- 
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, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Reopened: (MWAR-1) war:exploded removes content of .class files

Posted by "Stephane Nicoll (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MWAR-1?page=all ]
     
Stephane Nicoll reopened MWAR-1:
--------------------------------


> war:exploded removes content of .class files
> --------------------------------------------
>
>          Key: MWAR-1
>          URL: http://jira.codehaus.org/browse/MWAR-1
>      Project: Maven 2.x War Plugin
>         Type: Bug

>  Environment:  WIndowx XP
>     Reporter: Victor Yushenko
>     Assignee: Brett Porter
>      Fix For: 2.0
>  Attachments: MNG-1288-maven-war-plugin.patch
>
>
> To enable development in MyEclipse I have been configuring maven to build a folder with 'war' extention during the build. This then becomes an expanded folder that I can just copy (actually MyEclipse does it) to jboss for deployment.
> After the build my folder structure looks like this:
> --src
>     |-----main
> ...
> --target
>     |---testweb.war
>             |---css
>             |---WEB-INF
>                    |---- classes
>                    |---- lib
>                    |---- jsp
> I also configure compiler to compile files directy into target/${project.build.finalName}.war/WEB-INF/classes (which would be a target/testweb.war/WEB-INF/classes in the example above). This worked great in maven 1.* (I can change any file, eclipse compiles it into the class folder and MyEclipse immidiately deployes it to the JBoss). It also seemed to work for few hours in maven 2 (I only starrted using it today). Now if I do: "mvn package" I get proper exploded war except that all files in the 'classes' folder have 0 size. It seems that compiler creates good class files (and copies resources there) and then war plug-in comes along and wipes content of these files (but not files themselfs):
> Here is a snipped from my pom.xml:
>   <build>
>     <finalName>testweb.war</finalName>
>     <outputDirectory>target/${project.build.finalName}.war/WEB-INF/classes</outputDirectory>
>     <directory>target/war</directory>
> <plugins>
>         <plugin>
>             <groupId>org.apache.maven.plugins</groupId>
>             <artifactId>maven-war-plugin</artifactId>
>             <configuration>
>                 <webappDirectory>target/${project.build.finalName}.war</webappDirectory>
>             </configuration>
>          </plugin>
>      </plugins>
>   </build>
> As an experimet I did following steps:
> mvn compile - this produced expected results, compiled classes in the WEB-INF/classes folder
> then I did:
> mvn war:exploded - this command copied files from webapp and removed content from files produced by the compiler, so that all *.class files now have 0 bytes size...
> Interestingly enough it seemed to work for few hours and then just stoped. I have rebooted PC just to see and I still get the same result...
> my src\main\webapp\WEB-INF folder does not have classes folder, so I am not sure why war plug-in affects *.class files. 
> P.S. I mistakenly created another issue for maven-war (which now I am guessing is only related to maven 1...). MPWAR-51

-- 
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, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Commented: (MNG-1288) war:exploded removes content of .class files

Posted by "Victor Yushenko (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/MNG-1288?page=comments#action_49074 ] 

Victor Yushenko commented on MNG-1288:
--------------------------------------

I really needed to fix it so I looked at the code and made the fix. The problem is that if source and destination 'classes' folder is the same then files are emptied while plugins  tries to copy. Ideally this fix should be made in org.codehaus.plexus.util.FileUtils. FileUtils are used by this plugin to copy compiled classes into the staging directory. I fixed it by bypassing the copy if source and target directory are the same.
I changed this block (line 265 in AbstractWarMojo.java):
        if ( getClassesDirectory().exists() )
        {
            FileUtils.copyDirectoryStructure( getClassesDirectory(), webappClassesDirectory );
        }

to

        if ( getClassesDirectory().exists() && (!getClassesDirectory().equals(webappClassesDirectory)))
        {
            FileUtils.copyDirectoryStructure( getClassesDirectory(), webappClassesDirectory );
        }

 I'll try to attach an svn patch for this issue.


> war:exploded removes content of .class files
> --------------------------------------------
>
>          Key: MNG-1288
>          URL: http://jira.codehaus.org/browse/MNG-1288
>      Project: Maven 2
>         Type: Bug
>   Components: maven-war-plugin
>  Environment:  WIndowx XP
>     Reporter: Victor Yushenko
>  Attachments: MNG-1288-maven-war-plugin.patch
>
>
> To enable development in MyEclipse I have been configuring maven to build a folder with 'war' extention during the build. This then becomes an expanded folder that I can just copy (actually MyEclipse does it) to jboss for deployment.
> After the build my folder structure looks like this:
> --src
>     |-----main
> ...
> --target
>     |---testweb.war
>             |---css
>             |---WEB-INF
>                    |---- classes
>                    |---- lib
>                    |---- jsp
> I also configure compiler to compile files directy into target/${project.build.finalName}.war/WEB-INF/classes (which would be a target/testweb.war/WEB-INF/classes in the example above). This worked great in maven 1.* (I can change any file, eclipse compiles it into the class folder and MyEclipse immidiately deployes it to the JBoss). It also seemed to work for few hours in maven 2 (I only starrted using it today). Now if I do: "mvn package" I get proper exploded war except that all files in the 'classes' folder have 0 size. It seems that compiler creates good class files (and copies resources there) and then war plug-in comes along and wipes content of these files (but not files themselfs):
> Here is a snipped from my pom.xml:
>   <build>
>     <finalName>testweb.war</finalName>
>     <outputDirectory>target/${project.build.finalName}.war/WEB-INF/classes</outputDirectory>
>     <directory>target/war</directory>
> <plugins>
>         <plugin>
>             <groupId>org.apache.maven.plugins</groupId>
>             <artifactId>maven-war-plugin</artifactId>
>             <configuration>
>                 <webappDirectory>target/${project.build.finalName}.war</webappDirectory>
>             </configuration>
>          </plugin>
>      </plugins>
>   </build>
> As an experimet I did following steps:
> mvn compile - this produced expected results, compiled classes in the WEB-INF/classes folder
> then I did:
> mvn war:exploded - this command copied files from webapp and removed content from files produced by the compiler, so that all *.class files now have 0 bytes size...
> Interestingly enough it seemed to work for few hours and then just stoped. I have rebooted PC just to see and I still get the same result...
> my src\main\webapp\WEB-INF folder does not have classes folder, so I am not sure why war plug-in affects *.class files. 
> P.S. I mistakenly created another issue for maven-war (which now I am guessing is only related to maven 1...). MPWAR-51

-- 
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, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Closed: (MWAR-1) war:exploded removes content of .class files

Posted by "Stephane Nicoll (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MWAR-1?page=all ]
     
Stephane Nicoll closed MWAR-1:
------------------------------

     Resolution: Fixed
    Fix Version: 2.0

> war:exploded removes content of .class files
> --------------------------------------------
>
>          Key: MWAR-1
>          URL: http://jira.codehaus.org/browse/MWAR-1
>      Project: Maven 2.x War Plugin
>         Type: Bug

>  Environment:  WIndowx XP
>     Reporter: Victor Yushenko
>     Assignee: Brett Porter
>      Fix For: 2.0
>  Attachments: MNG-1288-maven-war-plugin.patch
>
>
> To enable development in MyEclipse I have been configuring maven to build a folder with 'war' extention during the build. This then becomes an expanded folder that I can just copy (actually MyEclipse does it) to jboss for deployment.
> After the build my folder structure looks like this:
> --src
>     |-----main
> ...
> --target
>     |---testweb.war
>             |---css
>             |---WEB-INF
>                    |---- classes
>                    |---- lib
>                    |---- jsp
> I also configure compiler to compile files directy into target/${project.build.finalName}.war/WEB-INF/classes (which would be a target/testweb.war/WEB-INF/classes in the example above). This worked great in maven 1.* (I can change any file, eclipse compiles it into the class folder and MyEclipse immidiately deployes it to the JBoss). It also seemed to work for few hours in maven 2 (I only starrted using it today). Now if I do: "mvn package" I get proper exploded war except that all files in the 'classes' folder have 0 size. It seems that compiler creates good class files (and copies resources there) and then war plug-in comes along and wipes content of these files (but not files themselfs):
> Here is a snipped from my pom.xml:
>   <build>
>     <finalName>testweb.war</finalName>
>     <outputDirectory>target/${project.build.finalName}.war/WEB-INF/classes</outputDirectory>
>     <directory>target/war</directory>
> <plugins>
>         <plugin>
>             <groupId>org.apache.maven.plugins</groupId>
>             <artifactId>maven-war-plugin</artifactId>
>             <configuration>
>                 <webappDirectory>target/${project.build.finalName}.war</webappDirectory>
>             </configuration>
>          </plugin>
>      </plugins>
>   </build>
> As an experimet I did following steps:
> mvn compile - this produced expected results, compiled classes in the WEB-INF/classes folder
> then I did:
> mvn war:exploded - this command copied files from webapp and removed content from files produced by the compiler, so that all *.class files now have 0 bytes size...
> Interestingly enough it seemed to work for few hours and then just stoped. I have rebooted PC just to see and I still get the same result...
> my src\main\webapp\WEB-INF folder does not have classes folder, so I am not sure why war plug-in affects *.class files. 
> P.S. I mistakenly created another issue for maven-war (which now I am guessing is only related to maven 1...). MPWAR-51

-- 
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, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[jira] Closed: (MNG-1288) war:exploded removes content of .class files

Posted by "Brett Porter (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/MNG-1288?page=all ]
     
Brett Porter closed MNG-1288:
-----------------------------

      Assign To: Brett Porter
     Resolution: Fixed
    Fix Version: 2.0.1

applied

> war:exploded removes content of .class files
> --------------------------------------------
>
>          Key: MNG-1288
>          URL: http://jira.codehaus.org/browse/MNG-1288
>      Project: Maven 2
>         Type: Bug
>   Components: maven-war-plugin
>  Environment:  WIndowx XP
>     Reporter: Victor Yushenko
>     Assignee: Brett Porter
>      Fix For: 2.0.1
>  Attachments: MNG-1288-maven-war-plugin.patch
>
>
> To enable development in MyEclipse I have been configuring maven to build a folder with 'war' extention during the build. This then becomes an expanded folder that I can just copy (actually MyEclipse does it) to jboss for deployment.
> After the build my folder structure looks like this:
> --src
>     |-----main
> ...
> --target
>     |---testweb.war
>             |---css
>             |---WEB-INF
>                    |---- classes
>                    |---- lib
>                    |---- jsp
> I also configure compiler to compile files directy into target/${project.build.finalName}.war/WEB-INF/classes (which would be a target/testweb.war/WEB-INF/classes in the example above). This worked great in maven 1.* (I can change any file, eclipse compiles it into the class folder and MyEclipse immidiately deployes it to the JBoss). It also seemed to work for few hours in maven 2 (I only starrted using it today). Now if I do: "mvn package" I get proper exploded war except that all files in the 'classes' folder have 0 size. It seems that compiler creates good class files (and copies resources there) and then war plug-in comes along and wipes content of these files (but not files themselfs):
> Here is a snipped from my pom.xml:
>   <build>
>     <finalName>testweb.war</finalName>
>     <outputDirectory>target/${project.build.finalName}.war/WEB-INF/classes</outputDirectory>
>     <directory>target/war</directory>
> <plugins>
>         <plugin>
>             <groupId>org.apache.maven.plugins</groupId>
>             <artifactId>maven-war-plugin</artifactId>
>             <configuration>
>                 <webappDirectory>target/${project.build.finalName}.war</webappDirectory>
>             </configuration>
>          </plugin>
>      </plugins>
>   </build>
> As an experimet I did following steps:
> mvn compile - this produced expected results, compiled classes in the WEB-INF/classes folder
> then I did:
> mvn war:exploded - this command copied files from webapp and removed content from files produced by the compiler, so that all *.class files now have 0 bytes size...
> Interestingly enough it seemed to work for few hours and then just stoped. I have rebooted PC just to see and I still get the same result...
> my src\main\webapp\WEB-INF folder does not have classes folder, so I am not sure why war plug-in affects *.class files. 
> P.S. I mistakenly created another issue for maven-war (which now I am guessing is only related to maven 1...). MPWAR-51

-- 
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, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org