[ http://jira.codehaus.org/browse/MSUREFIRE-58?page=comments#action_75898 ]
Zarar Siddiqi commented on MSUREFIRE-58:
----------------------------------------
OK, I'm trying to run StrutsTestCase with Maven 2.x and need the web.xml and
struts-config.xml to be in the classpath, which they are not by default.
So, I have the following configuration for the surefire plugin:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.2</version>
<configuration>
<classpathElements>
<classpathElement>target/${project.artifactId}-${project.version}</classpathElement>
</classpathElements>
</configuration>
</plugin>
And this expectedly yields:
Error configuring: org.apache.maven.plugins:maven-surefire-plugin. Reason:
ERROR: Cannot override read-only parameter: classpathElements in goal:
surefire:test
The reason this is expected is because an explanation is provided here:
http://www.nabble.com/testing-webapp-with-surefire-tf519140.html#a1403158
Brett Porter has recommended requesting another element called
additionalClasspathElements to be added which would not be read-only and thus
allow for additional classpath elements to be added.
I tried that using the following but it didn't get me anywhere.
<additionalClasspathElements>
<classpathElement>target/${project.artifactId}-${project.version}</classpathElement>
</additionalClasspathElements>
Any ideas?
> Cannot override read-only parameter: classpathElements
> ------------------------------------------------------
>
> Key: MSUREFIRE-58
> URL: http://jira.codehaus.org/browse/MSUREFIRE-58
> Project: Maven 2.x Surefire Plugin
> Issue Type: Bug
> Affects Versions: 2.1.2
> Reporter: Jesper Zedlitz
> Priority: Minor
> Fix For: 2.3
>
>
> When calling "mvn site" on a multi-module project the goal "surefire:test"
> fails for the second project:
> Error configuring: org.apache.maven.plugins:maven-surefire-plugin. Reason:
> ERROR: Cannot override read-only parameter: classpathElements in goal:
> surefire:test
> "mvn test" works and runs the tests on all modules.
--
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