Na segunda build do projeto, o plugin sugerido na aula não consegue realizar o undeploy. Investigando, identifiquei que o motivo que são os arquivos presentes na pasta lib do projeto que estão sendo utilizados pelo tomcat e não podem ser excluídos.
Como resolver esse problema?
Console do tomcat
dez 27, 2016 6:05:52 AM org.apache.catalina.startup.ExpandWar deleteDir
GRAVE: [C:\Desenvolvimento\Servidores\apache-tomcat-7.0.73\webapps\argentum-web]
could not be completely deleted. The presence of the remaining files may cause
problems
dez 27, 2016 6:05:52 AM org.apache.catalina.startup.ExpandWar delete
GRAVE: [C:\Desenvolvimento\Servidores\apache-tomcat-7.0.73\webapps\argentum-web]
could not be completely deleted. The presence of the remaining files may cause
problems
dez 27, 2016 6:05:52 AM org.apache.catalina.startup.HostConfig deployDirectory
INFORMAÃıES: Deploying web application directory C:\Desenvolvimento\Servidores\a
pache-tomcat-7.0.73\webapps\argentum-web
dez 27, 2016 6:05:53 AM org.apache.catalina.startup.TldConfig execute
INFORMAÃıES: At least one JAR was scanned for TLDs yet contained no TLDs. Enable
debug logging for this logger for a complete list of JARs that were scanned but
no TLDs were found in them. Skipping unneeded JARs during scanning can improve
startup time and JSP compilation time.
dez 27, 2016 6:05:53 AM org.apache.catalina.startup.HostConfig deployDirectory
INFORMAÃıES: Deployment of web application directory C:\Desenvolvimento\Servidor
es\apache-tomcat-7.0.73\webapps\argentum-web has finished in 468 ms
dez 27, 2016 6:19:52 AM org.apache.catalina.util.LifecycleBase stop
INFORMAÃıES: The stop() method was called on component [StandardEngine[Catalina]
.StandardHost[localhost].StandardContext[/argentum-web]] after stop() had alread
y been called. The second call will be ignored.
Console do Jenkins
Deploying C:\Users\Gustavo\.jenkins\workspace\argentum-web\target\argentum-web.war to container Tomcat 7.x Remote
Redeploying [C:\Users\Gustavo\.jenkins\workspace\argentum-web\target\argentum-web.war]
Undeploying [C:\Users\Gustavo\.jenkins\workspace\argentum-web\target\argentum-web.war]
ERROR: Build step failed with exception
org.codehaus.cargo.container.ContainerException: Failed to undeploy [C:\Users\Gustavo\.jenkins\workspace\argentum-web\target\argentum-web.war]
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.undeploy(AbstractTomcatManagerDeployer.java:140)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:178)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:73)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:116)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103)
at hudson.FilePath.act(FilePath.java:996)
at hudson.FilePath.act(FilePath.java:974)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
at hudson.model.Run.execute(Run.java:1754)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - Unable to delete [C:\Desenvolvimento\Servidores\apache-tomcat-7.0.73\webapps\argentum-web]. The continued presence of this file may cause problems.
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:566)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:480)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.undeploy(TomcatManager.java:420)
at org.codehaus.cargo.container.tomcat.Tomcat7xRemoteDeployer.performUndeploy(Tomcat7xRemoteDeployer.java:62)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.undeploy(AbstractTomcatManagerDeployer.java:130)
... 17 more
org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: FAIL - Unable to delete [C:\Desenvolvimento\Servidores\apache-tomcat-7.0.73\webapps\argentum-web]. The continued presence of this file may cause problems.
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:566)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:480)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.undeploy(TomcatManager.java:420)
at org.codehaus.cargo.container.tomcat.Tomcat7xRemoteDeployer.performUndeploy(Tomcat7xRemoteDeployer.java:62)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.undeploy(AbstractTomcatManagerDeployer.java:130)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:178)
at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:73)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:116)
at hudson.plugins.deploy.CargoContainerAdapter$1.invoke(CargoContainerAdapter.java:103)
at hudson.FilePath.act(FilePath.java:996)
at hudson.FilePath.act(FilePath.java:974)
at hudson.plugins.deploy.CargoContainerAdapter.redeploy(CargoContainerAdapter.java:103)
at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:61)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
at hudson.model.Run.execute(Run.java:1754)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Build step 'Deploy war/ear to a container' marked build as failure