The fix you added to the repo isn't right. Runtime will still cause the work around to be required. I presume there is no reason any junit is on the source path, it should therefore be 'test' scoped.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes there is a reason - the maven surefire plugin requires the scope to be compile, runtime or system otherwise the reports are not created during compile time.
mvn clean install site:site [INFO] Scanning for projects... [ERROR][ERROR] Some problems were encountered while processing the POMs: [ERROR] 'build.plugins.plugin[org.apache.maven.plugins:maven-surefire-plugin].dependencies.dependency.scope' for org.junit.jupiter:junit-jupiter-engine:jar must be one of [compile, runtime, system] but is 'test'. @ line 491, column 32 [ERROR] 'build.plugins.plugin[org.apache.maven.plugins:maven-surefire-plugin].dependencies.dependency.scope' for org.junit.vintage:junit-vintage-engine:jar must be one of [compile, runtime, system] but is 'test'. @ line 497, column 32
@ [ERROR] The build could not read 1 project -> [Help 1] [ERROR] [ERROR] The project com.opencsv:opencsv:5.11.2-SNAPSHOT (/Users/scott/Documents/workspace/opencsv-source/pom.xml) has 2 errors [ERROR] 'build.plugins.plugin[org.apache.maven.plugins:maven-surefire-plugin].dependencies.dependency.scope' for org.junit.jupiter:junit-jupiter-engine:jar must be one of [compile, runtime, system] but is 'test'. @ line 491, column 32 [ERROR] 'build.plugins.plugin[org.apache.maven.plugins:maven-surefire-plugin].dependencies.dependency.scope' for org.junit.vintage:junit-vintage-engine:jar must be one of [compile, runtime, system] but is 'test'. @ line 497, column 32 [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR][Help 1]http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
In the 5.11 release when I upgraded the junit versions I made them all default, compile, scope to simplify things and thus the bugs began. I am ASSuming it is because of concerns over final size with unused jar files or maybe some security concerns - I dunno.
I will go back through and put back the original scopes when I get a chance.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Workaround until fixed:
Last edit: David Thalmann 2025-06-02
The fix you added to the repo isn't right. Runtime will still cause the work around to be required. I presume there is no reason any junit is on the source path, it should therefore be 'test' scoped.
specifically https://sourceforge.net/p/opencsv/source/ci/fef22203d2e2a84e661f6e567a0c9a5454b73840/ is incorrect still.
I had the same issue after upgrading to opencsv 5.11.1, is there any reason why dependency junit-vintage-engine is in scope runtime instead of test?
Yes there is a reason - the maven surefire plugin requires the scope to be compile, runtime or system otherwise the reports are not created during compile time.
mvn clean install site:site
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] 'build.plugins.plugin[org.apache.maven.plugins:maven-surefire-plugin].dependencies.dependency.scope' for org.junit.jupiter:junit-jupiter-engine:jar must be one of [compile, runtime, system] but is 'test'. @ line 491, column 32
[ERROR] 'build.plugins.plugin[org.apache.maven.plugins:maven-surefire-plugin].dependencies.dependency.scope' for org.junit.vintage:junit-vintage-engine:jar must be one of [compile, runtime, system] but is 'test'. @ line 497, column 32
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project com.opencsv:opencsv:5.11.2-SNAPSHOT (/Users/scott/Documents/workspace/opencsv-source/pom.xml) has 2 errors
[ERROR] 'build.plugins.plugin[org.apache.maven.plugins:maven-surefire-plugin].dependencies.dependency.scope' for org.junit.jupiter:junit-jupiter-engine:jar must be one of [compile, runtime, system] but is 'test'. @ line 491, column 32
[ERROR] 'build.plugins.plugin[org.apache.maven.plugins:maven-surefire-plugin].dependencies.dependency.scope' for org.junit.vintage:junit-vintage-engine:jar must be one of [compile, runtime, system] but is 'test'. @ line 497, column 32
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
In the 5.11 release when I upgraded the junit versions I made them all default, compile, scope to simplify things and thus the bugs began. I am ASSuming it is because of concerns over final size with unused jar files or maybe some security concerns - I dunno.
I will go back through and put back the original scopes when I get a chance.
fixed in 5.11.2 release.