You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Ramos, Victor Hugo Barbosa (Victor Hugo)" <vr...@avaya.com> on 2007/03/09 15:33:39 UTC

Error on site generation when using maven-war-plugin

Hi All,
	I need to package my application into a war file before the test
phase to do some web tests, so I included the following code in my
pom.xml:

<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-war-plugin</artifactId>
	<executions>
		<execution>
			<phase>generate-test-resources</phase>
			<goals>
			<goal>war</goal>
			</goals>
			<configuration>
	
<outputDirectory>${project.build.directory}/testWar/</outputDirectory>
			</configuration>
		</execution>
	</executions>
</plugin>

When I run the command mvn package evething works fine, but when I
generate the project site (mvn site) the following error occurs:

[INFO] [aspectj:compile {execution: default}]
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error configuring: org.apache.maven.plugins:maven-war-plugin.
Reason: ERR
OR: Cannot override read-only parameter: classesDirectory in goal:
war:war
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error
configuring: org.a
pache.maven.plugins:maven-war-plugin. Reason: ERROR: Cannot override
read-only p
arameter: classesDirectory in goal: war:war
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:563)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:475)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecy
cle(DefaultLifecycleExecutor.java:891)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(Def
aultLifecycleExecutor.java:734)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:525)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:475)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:454)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:306)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:273)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:140)
        at
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        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.apache.maven.plugin.PluginConfigurationException: Error
configuri
ng: org.apache.maven.plugins:maven-war-plugin. Reason: ERROR: Cannot
override re
ad-only parameter: classesDirectory in goal: war:war
        at
org.apache.maven.plugin.DefaultPluginManager.validatePomConfiguration
(DefaultPluginManager.java:848)
        at
org.apache.maven.plugin.DefaultPluginManager.getConfiguredMojo(Defaul
tPluginManager.java:558)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:390)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:534)
        ... 20 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 14 seconds
[INFO] Finished at: Fri Mar 09 11:20:58 BRT 2007
[INFO] Final Memory: 30M/54M
[INFO]
------------------------------------------------------------------------

As you see I did not change the classesDirectory, I already tried to
remove the outputDirectory configuration but the same error occurred.

Thanks in advance,

Victor Hugo B. Ramos
Avaya Brazil
CSI Software and Custom Application

Important : This e-mail is intended for the above named only and may be
confidential, proprietary and/or legally privileged. If this has come to
you in error, you must take no action based on it, nor must you copy or
show it to anyone. Please contact the sender and delete the material
from any computer. Thank you.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org