[ 
https://issues.apache.org/jira/browse/MWAR-433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17147266#comment-17147266
 ] 

Herve Boutemy edited comment on MWAR-433 at 6/28/20, 9:02 AM:
--------------------------------------------------------------

as I feared, this algorithm of "do not take files newer that the build start in 
the outdated removal process" implemented in the MWAR-433 branch 
https://github.com/apache/maven-war-plugin/tree/MWAR-433 works only half the 
time: if the process that generated the resources doesn't update them when they 
are already there and up-to-date, on the second build, resources are not 
refreshed, then become outdated and are removed (then are generated again on 
third build):
{noformat}$ mvn clean package
[...]
[INFO] --- maven-war-plugin:3.3.1-SNAPSHOT:war (default-war) @ example-webapp 
---
[INFO] Packaging webapp
[INFO] Assembling webapp [example-webapp] in 
[/home/herve/tmp/maven-war-plugin-bug/example-webapp/target/example-webapp-1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources 
[/home/herve/tmp/maven-war-plugin-bug/example-webapp/src/main/webapp]
[INFO] Building war: 
/home/herve/tmp/maven-war-plugin-bug/example-webapp/target/example-webapp-1.0-SNAPSHOT.war
[...]
$ mvn package
[...]
[INFO] --- maven-war-plugin:3.3.1-SNAPSHOT:war (default-war) @ example-webapp 
---
[INFO] Packaging webapp
[INFO] Assembling webapp [example-webapp] in 
[/home/herve/tmp/maven-war-plugin-bug/example-webapp/target/example-webapp-1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources 
[/home/herve/tmp/maven-war-plugin-bug/example-webapp/src/main/webapp]
[INFO] deleting outdated resource docs/data.html
[INFO] deleting outdated resource docs/xml_ns1_exampleOutput.html
[INFO] deleting outdated resource docs/syntax_xml.html
[INFO] deleting outdated resource docs/service_ns0_ExampleWebService.html
[INFO] deleting outdated resource docs/css/enunciate.css
[INFO] deleting outdated resource docs/xml_ns1_exampleInput.html
[INFO] deleting outdated resource docs/index.html
[INFO] deleting outdated resource docs/services.html
[INFO] Building war: 
/home/herve/tmp/maven-war-plugin-bug/example-webapp/target/example-webapp-1.0-SNAPSHOT.war
[...]{noformat}

we'll need something additional, or even revert MWAR-427
at least now, the INFO message "deleting outdated resource" gives a chance to 
understand why content is disappearing

should we add a configuration to exclude some resources from outdated 
processing?
any other idea?


was (Author: hboutemy):
as I feared, this algorithm of "do not take files newer that the build start in 
the outdated removal process" implemented in the MWAR-433 branch 
https://github.com/apache/maven-war-plugin/tree/MWAR-433 works only half the 
time: if the process that generated the resources doesn't update it when they 
are already there and up-to-date, on the second build, resources are not 
refreshed, then become outdated and are removed (then are generated again on 
third build):
{noformat}$ mvn clean package
[...]
[INFO] --- maven-war-plugin:3.3.1-SNAPSHOT:war (default-war) @ example-webapp 
---
[INFO] Packaging webapp
[INFO] Assembling webapp [example-webapp] in 
[/home/herve/tmp/maven-war-plugin-bug/example-webapp/target/example-webapp-1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources 
[/home/herve/tmp/maven-war-plugin-bug/example-webapp/src/main/webapp]
[INFO] Building war: 
/home/herve/tmp/maven-war-plugin-bug/example-webapp/target/example-webapp-1.0-SNAPSHOT.war
[...]
$ mvn package
[...]
[INFO] --- maven-war-plugin:3.3.1-SNAPSHOT:war (default-war) @ example-webapp 
---
[INFO] Packaging webapp
[INFO] Assembling webapp [example-webapp] in 
[/home/herve/tmp/maven-war-plugin-bug/example-webapp/target/example-webapp-1.0-SNAPSHOT]
[INFO] Processing war project
[INFO] Copying webapp resources 
[/home/herve/tmp/maven-war-plugin-bug/example-webapp/src/main/webapp]
[INFO] deleting outdated resource docs/data.html
[INFO] deleting outdated resource docs/xml_ns1_exampleOutput.html
[INFO] deleting outdated resource docs/syntax_xml.html
[INFO] deleting outdated resource docs/service_ns0_ExampleWebService.html
[INFO] deleting outdated resource docs/css/enunciate.css
[INFO] deleting outdated resource docs/xml_ns1_exampleInput.html
[INFO] deleting outdated resource docs/index.html
[INFO] deleting outdated resource docs/services.html
[INFO] Building war: 
/home/herve/tmp/maven-war-plugin-bug/example-webapp/target/example-webapp-1.0-SNAPSHOT.war
[...]{noformat}

we'll need something additional, or even revert MWAR-427
at least now, the INFO message "deleting outdated resource" gives a chance to 
understand why content is disappearing

should we add a configuration to exclude some resources from outdated 
processing?
any other idea?

> Maven WAR plugin is deleting files generated by other plugins after upgrading 
> to 3.3.0
> --------------------------------------------------------------------------------------
>
>                 Key: MWAR-433
>                 URL: https://issues.apache.org/jira/browse/MWAR-433
>             Project: Maven WAR Plugin
>          Issue Type: Bug
>    Affects Versions: 3.3.0
>            Reporter: Kyle Lieber
>            Priority: Critical
>             Fix For: 3.3.1
>
>
> My project generates wsdls using the {{jaxws-maven-plugin}} which puts the 
> generated wsdls in 
> {{${project.build.directory}/${project.build.finalName}/WEB-INF/wsdls}} so 
> that they are packaged up in the war file. Then I have a client jar that 
> copies those wsdls out of the war file using the {{maven-dependency-plugin}} 
> and generates a client from the wsdls using the {{jaxws-maven-plugin}}.
> This all works fine using {{3.2.3}} of the {{maven-war-plugin}}.  However, 
> after upgrading to {{3.3.0}} my project fails to build because the wsdls are 
> no longer preserved.  It seems that they are being deleted by the 
> {{maven-war-plugin}}.
> I created an example project on Github which recreates the problem.  The 
> {{master}} branch is using {{3.2.3}} and the {{maven-war-plugin-3.3.0}} 
> branch is using {{3.3.0}}.  You can find more details in the readme file of 
> the example project:
> https://github.com/klieber/maven-war-plugin-bug
> I also suspect that MWAR-427 is the change that introduced this bug.
> Please let me know if there is anymore information I can provide.  Thanks!



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to