使用带有 Cargo 插件的 Maven 时出现问题

发布于 2024-08-02 03:54:14 字数 11419 浏览 6 评论 0原文

当我使用带有货物插件的 Maven 来处理 tomcat 的热部署时,如果 .war 工件当前不存在,则 Maven 无法完成清理任务。 因此,如果我运行 mvn clean,然后运行 ​​mvn clean package - 它会出错。 我该怎么做才能让货物忽略这一点?

C:\work2\Fresh\fresh-ui>mvn clean
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building fresh-ui
[INFO]    task-segment: [clean]
[INFO] ------------------------------------------------------------------------
[INFO] [cargo:deployer-undeploy {execution: clean-undeploy}]
[INFO] [mcat5xRemoteDeployer] Undeploying [C:\work2\Fresh\fresh-ui\target\fresh.
war]
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting directory C:\work2\Fresh\fresh-ui\target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Tue Aug 18 09:49:16 PDT 2009
[INFO] Final Memory: 9M/16M
[INFO] ------------------------------------------------------------------------
C:\work2\Fresh\fresh-ui>mvn clean
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building fresh-ui
[INFO]    task-segment: [clean]
[INFO] ------------------------------------------------------------------------
[INFO] [cargo:deployer-undeploy {execution: clean-undeploy}]
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to create deployable for the parameters (container [id = [tomcat5x
]], deployable type [war]).
C:\work2\Fresh\fresh-ui\target\fresh.war (The system cannot find the path specif
ied)
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.codehaus.cargo.container.ContainerException: Failed to create deployable for
 the parameters (container [id = [tomcat5x]], deployable type [war]).
        at org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.createImple
mentation(AbstractGenericHintFactory.java:157)
        at org.codehaus.cargo.generic.spi.AbstractIntrospectionGenericHintFactor
y.createImplementation(AbstractIntrospectionGenericHintFactory.java:86)
        at org.codehaus.cargo.generic.deployable.DefaultDeployableFactory.create
Deployable(DefaultDeployableFactory.java:163)
        at org.codehaus.cargo.maven2.configuration.Deployable.createDeployable(D
eployable.java:136)
        at org.codehaus.cargo.maven2.AbstractDeployerMojo.performDeployerActionO
nAllDeployables(AbstractDeployerMojo.java:99)
        at org.codehaus.cargo.maven2.AbstractDeployerMojo.doExecute(AbstractDepl
oyerMojo.java:47)
        at org.codehaus.cargo.maven2.AbstractCargoMojo.execute(AbstractCargoMojo
.java:255)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:483)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:678)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:540)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:519)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:371)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:332)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:181)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:4
1)
        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: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at org.codehaus.cargo.generic.deployable.DefaultDeployableFactory.create
Instance(DefaultDeployableFactory.java:196)
        at org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.createImple
mentation(AbstractGenericHintFactory.java:153)
        ... 25 more
Caused by: org.codehaus.cargo.container.ContainerException: Failed to parse Tomc
at WAR file in [C:\work2\Fresh\fresh-ui\target\fresh.war]
        at org.codehaus.cargo.container.tomcat.TomcatWAR.<init>(TomcatWAR.java:5
5)
        ... 31 more
Caused by: org.codehaus.cargo.util.CargoException: Failed to find file [C:\work2
\Fresh\fresh-ui\target\fresh.war]
        at org.codehaus.cargo.util.DefaultFileHandler.getInputStream(DefaultFile
Handler.java:351)
        at org.codehaus.cargo.module.DefaultJarArchive.getContentAsStream(Defaul
tJarArchive.java:231)
        at org.codehaus.cargo.module.DefaultJarArchive.getResource(DefaultJarArc
hive.java:154)
        at org.codehaus.cargo.module.webapp.tomcat.TomcatWarArchive.parseTomcatC
ontextXml(TomcatWarArchive.java:92)
        at org.codehaus.cargo.module.webapp.tomcat.TomcatWarArchive.<init>(Tomca
tWarArchive.java:61)
        at org.codehaus.cargo.container.tomcat.TomcatWAR.<init>(TomcatWAR.java:5
1)
        ... 31 more
Caused by: java.io.FileNotFoundException: C:\work2\Fresh\fresh-ui\target\fresh.w
ar (The system cannot find the path specified)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:106)
        at org.codehaus.cargo.util.DefaultFileHandler.getInputStream(DefaultFile
Handler.java:347)
        ... 36 more
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at org.codehaus.cargo.generic.deployable.DefaultDeployableFactory.create
Instance(DefaultDeployableFactory.java:196)
        at org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.createImple
mentation(AbstractGenericHintFactory.java:153)
        at org.codehaus.cargo.generic.spi.AbstractIntrospectionGenericHintFactor
y.createImplementation(AbstractIntrospectionGenericHintFactory.java:86)
        at org.codehaus.cargo.generic.deployable.DefaultDeployableFactory.create
Deployable(DefaultDeployableFactory.java:163)
        at org.codehaus.cargo.maven2.configuration.Deployable.createDeployable(D
eployable.java:136)
        at org.codehaus.cargo.maven2.AbstractDeployerMojo.performDeployerActionO
nAllDeployables(AbstractDeployerMojo.java:99)
        at org.codehaus.cargo.maven2.AbstractDeployerMojo.doExecute(AbstractDepl
oyerMojo.java:47)
        at org.codehaus.cargo.maven2.AbstractCargoMojo.execute(AbstractCargoMojo
.java:255)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:483)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:678)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:540)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:519)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:371)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:332)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:181)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:4
1)
        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.codehaus.cargo.container.ContainerException: Failed to parse Tomc
at WAR file in [C:\work2\Fresh\fresh-ui\target\fresh.war]
        at org.codehaus.cargo.container.tomcat.TomcatWAR.<init>(TomcatWAR.java:5
5)
        ... 31 more
Caused by: org.codehaus.cargo.util.CargoException: Failed to find file [C:\work2
\Fresh\fresh-ui\target\fresh.war]
        at org.codehaus.cargo.util.DefaultFileHandler.getInputStream(DefaultFile
Handler.java:351)
        at org.codehaus.cargo.module.DefaultJarArchive.getContentAsStream(Defaul
tJarArchive.java:231)
        at org.codehaus.cargo.module.DefaultJarArchive.getResource(DefaultJarArc
hive.java:154)
        at org.codehaus.cargo.module.webapp.tomcat.TomcatWarArchive.parseTomcatC
ontextXml(TomcatWarArchive.java:92)
        at org.codehaus.cargo.module.webapp.tomcat.TomcatWarArchive.<init>(Tomca
tWarArchive.java:61)
        at org.codehaus.cargo.container.tomcat.TomcatWAR.<init>(TomcatWAR.java:5
1)
        ... 31 more
Caused by: java.io.FileNotFoundException: C:\work2\Fresh\fresh-ui\target\fresh.w
ar (The system cannot find the path specified)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:106)
        at org.codehaus.cargo.util.DefaultFileHandler.getInputStream(DefaultFile
Handler.java:347)
        ... 36 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Tue Aug 18 09:49:22 PDT 2009
[INFO] Final Memory: 8M/16M
[INFO] ------------------------------------------------------------------------
C:\work2\Fresh\fresh-ui>

When I'm using Maven with the cargo plug-ing to handle hot deployments to tomcat, maven fails on the clean task if the .war artifact doesn't currently exist. So if I run mvn clean, then mvn clean package - it errors out. What can I do to have cargo ignore that?

C:\work2\Fresh\fresh-ui>mvn clean
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building fresh-ui
[INFO]    task-segment: [clean]
[INFO] ------------------------------------------------------------------------
[INFO] [cargo:deployer-undeploy {execution: clean-undeploy}]
[INFO] [mcat5xRemoteDeployer] Undeploying [C:\work2\Fresh\fresh-ui\target\fresh.
war]
[INFO] [clean:clean {execution: default-clean}]
[INFO] Deleting directory C:\work2\Fresh\fresh-ui\target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Tue Aug 18 09:49:16 PDT 2009
[INFO] Final Memory: 9M/16M
[INFO] ------------------------------------------------------------------------
C:\work2\Fresh\fresh-ui>mvn clean
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building fresh-ui
[INFO]    task-segment: [clean]
[INFO] ------------------------------------------------------------------------
[INFO] [cargo:deployer-undeploy {execution: clean-undeploy}]
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to create deployable for the parameters (container [id = [tomcat5x
]], deployable type [war]).
C:\work2\Fresh\fresh-ui\target\fresh.war (The system cannot find the path specif
ied)
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.codehaus.cargo.container.ContainerException: Failed to create deployable for
 the parameters (container [id = [tomcat5x]], deployable type [war]).
        at org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.createImple
mentation(AbstractGenericHintFactory.java:157)
        at org.codehaus.cargo.generic.spi.AbstractIntrospectionGenericHintFactor
y.createImplementation(AbstractIntrospectionGenericHintFactory.java:86)
        at org.codehaus.cargo.generic.deployable.DefaultDeployableFactory.create
Deployable(DefaultDeployableFactory.java:163)
        at org.codehaus.cargo.maven2.configuration.Deployable.createDeployable(D
eployable.java:136)
        at org.codehaus.cargo.maven2.AbstractDeployerMojo.performDeployerActionO
nAllDeployables(AbstractDeployerMojo.java:99)
        at org.codehaus.cargo.maven2.AbstractDeployerMojo.doExecute(AbstractDepl
oyerMojo.java:47)
        at org.codehaus.cargo.maven2.AbstractCargoMojo.execute(AbstractCargoMojo
.java:255)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:483)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:678)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:540)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:519)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:371)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:332)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:181)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:4
1)
        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: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at org.codehaus.cargo.generic.deployable.DefaultDeployableFactory.create
Instance(DefaultDeployableFactory.java:196)
        at org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.createImple
mentation(AbstractGenericHintFactory.java:153)
        ... 25 more
Caused by: org.codehaus.cargo.container.ContainerException: Failed to parse Tomc
at WAR file in [C:\work2\Fresh\fresh-ui\target\fresh.war]
        at org.codehaus.cargo.container.tomcat.TomcatWAR.<init>(TomcatWAR.java:5
5)
        ... 31 more
Caused by: org.codehaus.cargo.util.CargoException: Failed to find file [C:\work2
\Fresh\fresh-ui\target\fresh.war]
        at org.codehaus.cargo.util.DefaultFileHandler.getInputStream(DefaultFile
Handler.java:351)
        at org.codehaus.cargo.module.DefaultJarArchive.getContentAsStream(Defaul
tJarArchive.java:231)
        at org.codehaus.cargo.module.DefaultJarArchive.getResource(DefaultJarArc
hive.java:154)
        at org.codehaus.cargo.module.webapp.tomcat.TomcatWarArchive.parseTomcatC
ontextXml(TomcatWarArchive.java:92)
        at org.codehaus.cargo.module.webapp.tomcat.TomcatWarArchive.<init>(Tomca
tWarArchive.java:61)
        at org.codehaus.cargo.container.tomcat.TomcatWAR.<init>(TomcatWAR.java:5
1)
        ... 31 more
Caused by: java.io.FileNotFoundException: C:\work2\Fresh\fresh-ui\target\fresh.w
ar (The system cannot find the path specified)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:106)
        at org.codehaus.cargo.util.DefaultFileHandler.getInputStream(DefaultFile
Handler.java:347)
        ... 36 more
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at org.codehaus.cargo.generic.deployable.DefaultDeployableFactory.create
Instance(DefaultDeployableFactory.java:196)
        at org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.createImple
mentation(AbstractGenericHintFactory.java:153)
        at org.codehaus.cargo.generic.spi.AbstractIntrospectionGenericHintFactor
y.createImplementation(AbstractIntrospectionGenericHintFactory.java:86)
        at org.codehaus.cargo.generic.deployable.DefaultDeployableFactory.create
Deployable(DefaultDeployableFactory.java:163)
        at org.codehaus.cargo.maven2.configuration.Deployable.createDeployable(D
eployable.java:136)
        at org.codehaus.cargo.maven2.AbstractDeployerMojo.performDeployerActionO
nAllDeployables(AbstractDeployerMojo.java:99)
        at org.codehaus.cargo.maven2.AbstractDeployerMojo.doExecute(AbstractDepl
oyerMojo.java:47)
        at org.codehaus.cargo.maven2.AbstractCargoMojo.execute(AbstractCargoMojo
.java:255)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:483)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:678)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:540)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:519)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:371)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:332)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:181)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:4
1)
        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.codehaus.cargo.container.ContainerException: Failed to parse Tomc
at WAR file in [C:\work2\Fresh\fresh-ui\target\fresh.war]
        at org.codehaus.cargo.container.tomcat.TomcatWAR.<init>(TomcatWAR.java:5
5)
        ... 31 more
Caused by: org.codehaus.cargo.util.CargoException: Failed to find file [C:\work2
\Fresh\fresh-ui\target\fresh.war]
        at org.codehaus.cargo.util.DefaultFileHandler.getInputStream(DefaultFile
Handler.java:351)
        at org.codehaus.cargo.module.DefaultJarArchive.getContentAsStream(Defaul
tJarArchive.java:231)
        at org.codehaus.cargo.module.DefaultJarArchive.getResource(DefaultJarArc
hive.java:154)
        at org.codehaus.cargo.module.webapp.tomcat.TomcatWarArchive.parseTomcatC
ontextXml(TomcatWarArchive.java:92)
        at org.codehaus.cargo.module.webapp.tomcat.TomcatWarArchive.<init>(Tomca
tWarArchive.java:61)
        at org.codehaus.cargo.container.tomcat.TomcatWAR.<init>(TomcatWAR.java:5
1)
        ... 31 more
Caused by: java.io.FileNotFoundException: C:\work2\Fresh\fresh-ui\target\fresh.w
ar (The system cannot find the path specified)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:106)
        at org.codehaus.cargo.util.DefaultFileHandler.getInputStream(DefaultFile
Handler.java:347)
        ... 36 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Tue Aug 18 09:49:22 PDT 2009
[INFO] Final Memory: 8M/16M
[INFO] ------------------------------------------------------------------------
C:\work2\Fresh\fresh-ui>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眉目亦如画i 2024-08-09 03:54:14

据我所知,您已将 deployer-undeploy 绑定到 clean 生命周期的 pre-clean 阶段。 因此,当执行第一次clean时,战争被安全地取消部署,然后target被删除。 执行第二次清理时,cargo:deployer-undeploy 无法在 target 中找到 war 并失败。

对我来说,Cargo 不应该失败,这可能是 Cargo 的 maven 2 插件或核心 API 中的错误,应该优雅地处理这种情况。 我会在 Cargo 的 问题跟踪器

正如 Rich 在评论中提到的,当前的解决方法是仅运行 clean 一次。

From what I can see, you've bound deployer-undeploy to the pre-clean phase of the clean lifecycle. Thus, when performing the first clean, the war is safely undeployed and then target is removed. When performing the second clean, cargo:deployer-undeploy can't find the war in target and fails.

To me, Cargo shouldn't fail and this is likely a bug in Cargo's maven 2 plugin or in the core API that should handle this case gracefully. I'd open an issue in Cargo's issue tracker.

As mentioned by Rich in a comment, the current workaround is to run clean only once.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文