[jetty-dev] [jira] (JETTY-1491) jetty-maven-plugin ignores <useTestClasspath> and/or <userTestScope> since 7.5.2.v20111006 and 8.0.3.v20111011

"Jan Bartel (JIRA)" <[email protected]>
Newsgroups gmane.comp.java.jetty.general
Message-ID <449861906.44101.1330410123181.JavaMail.j2ee-jira@codehaus01.managed.contegix.com>
    [ https://jira.codehaus.org/browse/JETTY-1491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=292893#comment-292893 ] 

Jan Bartel commented on JETTY-1491:
-----------------------------------

Martin,

Which version of maven are you using? I tried your test case and it seems to work for me with no errors produced, so I suspect it is a difference of maven version. My version is 3.0.3.

That said, it may be better if I change the dependencyResolution to "test" instead ... I'll have a read and fiddle with that and get back to you.

Jan
                
> jetty-maven-plugin ignores <useTestClasspath> and/or <userTestScope> since 7.5.2.v20111006 and 8.0.3.v20111011
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: JETTY-1491
>                 URL: https://jira.codehaus.org/browse/JETTY-1491
>             Project: Jetty
>          Issue Type: Bug
>          Components: Maven
>    Affects Versions: 7.5.2, 7.5.3, 7.5.4, 7.6.0, 7.6.1, 8.0.3, 8.0.4, 8.1.0
>         Environment: Apache Maven 3.0.4 (r1232337; 2012-01-17 19:44:56+1100)
> Maven home: /usr/local/Cellar/maven/3.0.4/libexec
> Java version: 1.6.0_29, vendor: Apple Inc.
> Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
> Default locale: en_US, platform encoding: MacRoman
> OS name: "mac os x", version: "10.7.3", arch: "x86_64", family: "mac"
>            Reporter: Martin Lau
>            Assignee: Jan Bartel
>         Attachments: jetty-testcase.zip
>
>
> The 7.5.2 and 8.0.3 releases of the jetty-maven-plugin have broken the useTestClasspath and/or useTestScope options.
> The attached sample project illustrates the issue through a couple of JUnit test cases which use httpclient to connect to a jetty instance started through the maven plugin (using Class.forName to resolve classes from different scopes).
> I believe the problem is due to using the combination of the following in [JettyRunMojo.java|https://fisheye.codehaus.org/browse/jetty-project/jetty-maven-plugin/src/main/java/org/mortbay/jetty/plugin/JettyRunMojo.java?r=916ee51c42cc1a60904e98772006c60d71b81ae2]:
> {code:title=JettyRunMojo.java:57}
> /* 
>  * @requiresDependencyResolution compile+runtime
>  */
> {code}
> and
> {code:title=JettyRunMojo.java:437}
> for ( Iterator<Artifact> iter = projectArtifacts.iterator(); iter.hasNext(); )
> {
>     // snip
>     if (((!Artifact.SCOPE_PROVIDED.equals(artifact.getScope())) && (!Artifact.SCOPE_TEST.equals( artifact.getScope())))
>                    ||
>                (useTestClasspath && Artifact.SCOPE_TEST.equals( artifact.getScope())))
>            {
>            }
> }
> {code}
> It appears that the for loop is assuming all artifacts will be available, and attempting to filter out the test dependencies if useTestScope is specified. However, since the @requireDependencyResolution doesn't include +test, these aren't available.
> I haven't had a chance to verify this (hence no patch to offer just yet) - but I'll try and get something sorted out to confirm this in the next few days (unless someone on the other end can verify ahead of time).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.