You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Björn Michael (Jira)" <ji...@apache.org> on 2020/10/07 06:59:00 UTC

[jira] [Comment Edited] (MNG-6545) Scope runtime test

    [ https://issues.apache.org/jira/browse/MNG-6545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17209333#comment-17209333 ] 

Björn Michael edited comment on MNG-6545 at 10/7/20, 6:58 AM:
--------------------------------------------------------------

Some test libraries like Google Truth still have a juni4 dependency although all tests are written and converted to junit5.
Due to a missing _test-runtime_ scope developers still accidentially import / use methods from org.junit.Assert.* which they couldn't if one could set junit:junit to test-runtime scope.

Fine-grained logger configurations for tests are another example where a scope test-runtime is required.

https://stackoverflow.com/questions/27726779/declare-maven-dependency-as-test-runtime-only


was (Author: mtomcat_daobi):
Some test libraries like Google Truth still have a juni4 dependency although all tests are written and converted to junit5.
Due to a missing _test-runtime_ scope developers still accidentially import / use methods from org.junit.Assert.* which they couldn't if one could set junit:junit to test-runtime scope.

> Scope runtime test
> ------------------
>
>                 Key: MNG-6545
>                 URL: https://issues.apache.org/jira/browse/MNG-6545
>             Project: Maven
>          Issue Type: Improvement
>          Components: Dependencies
>            Reporter: Olivier Cailloux
>            Priority: Minor
>
> Maven should permit to include a dependency with scope restricted to test and runtime. Currently we have to choose between test and runtime, having both would be better.
> It would permit Maven to check that the test code does not depend (for compilation) on those libraries. And you wouldn’t get annoyed by completion proposals in your IDE coming from those runtime libraries.
> It is also conceptually more elegant and would make the intent clear to other contributers (“make sure your test code does not depend on this library”).
> Also discussed [here|https://mail-archives.apache.org/mod_mbox/maven-users/200811.mbox/%3c17608340.3674701226307519843.JavaMail.adm-moff@moffice8.nsc.no%3e] and [here|https://stackoverflow.com/a/27729783].



--
This message was sent by Atlassian Jira
(v8.3.4#803005)