maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "A (JIRA)" <j...@codehaus.org>
Subject [jira] Commented: (SUREFIRE-576) Have the abiltiy to remove a dependency from the test classpath (at least optional ones
Date Fri, 21 May 2010 05:24:12 GMT

    [ http://jira.codehaus.org/browse/SUREFIRE-576?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=222001#action_222001
] 

A commented on SUREFIRE-576:
----------------------------

I've tested the new commit. It appears to be working for my purposes - testing a packaged
for distribution product rather than the project compiled classes. Thank you for implementing
this feature!

I'm putting below a sample configuration just for a reference. I see that system dependencies
can be excluded either by the "test" scope or with their group and artifact id. Also the build
classes can be excluded by configuring a fake location for them and although looking hacky,
this method seems reasonable to me.

{code:xml}
    <profile>
      <id>product-test</id>
      <activation>
         <activeByDefault>false</activeByDefault>
      </activation>
      <build>
         <plugins>
            <plugin>
               <artifactId>maven-surefire-plugin</artifactId>
               <version>2.6-SNAPSHOT</version>
               <configuration>
                  <classesDirectory>fakeClassesDirectory</classesDirectory>
                  <!-- testClassesDirectory>fakeTestClassesDirectory</testClassesDirectory
-->
                  <classpathDependencyScopeExclude>runtime</classpathDependencyScopeExclude>
                  <classpathDependencyExcludes>
                     <exclude>org.apache.commons:*</exclude>
                     <exclude>testGrp:testId</exclude>
                  </classpathDependencyExcludes>
                  <additionalClasspathElements>
                     <additionalClasspathElement>/path/to/product/installation/artifact1.jar</additionalClasspathElement>
                     <additionalClasspathElement>/path/to/product/installation/artifact2.jar</additionalClasspathElement>
                  </additionalClasspathElements>
               </configuration>
            </plugin>
         </plugins>
      </build>
    </profile>
{code}

Then tester should look at the mvn -Pproduct-test -X output (search for "Test Classpath")to
verify classpath is what's expected. btw it will become more convenient once MNG-2570 is resolved
and debug logging only from the SurefirePlugin class can be enabled through CLI rather than
full debug of everything.

> Have the abiltiy to remove a dependency from the test classpath (at least optional ones
> ---------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-576
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-576
>             Project: Maven Surefire
>          Issue Type: New Feature
>          Components: classloading, Maven Surefire Plugin
>            Reporter: Hardy Ferentschik
>            Assignee: Paul Gier
>             Fix For: 2.6
>
>


-- 
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

        

Mime
View raw message