Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle 7: testCompile configuration not found #183

Closed
Siedlerchr opened this issue Apr 12, 2021 · 6 comments
Closed

Gradle 7: testCompile configuration not found #183

Siedlerchr opened this issue Apr 12, 2021 · 6 comments

Comments

@Siedlerchr
Copy link

Siedlerchr commented Apr 12, 2021

Hi,

just upgraded to Gradle 7.0 and I got the error:

https://github.com/JabRef/jabref/runs/2326342995?check_suite_focus=true

Execution failed for task ':compileTestJava'.
Configuration with name 'testCompile' not found.



Caused by: org.gradle.api.artifacts.UnknownConfigurationException: Configuration with name 'testCompile' not found.
	at org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer.createNotFoundException(DefaultConfigurationContainer.java:165)
	at org.gradle.api.internal.DefaultNamedDomainObjectCollection.getByName(DefaultNamedDomainObjectCollection.java:333)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer.getByName(DefaultConfigurationContainer.java:155)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer.getByName(DefaultConfigurationContainer.java:64)
	at org.javamodularity.moduleplugin.TestEngine.selectMultiple(TestEngine.java:45)
	at org.javamodularity.moduleplugin.tasks.CompileTestTask.buildCompilerArgs(CompileTestTask.java:61)
	at org.javamodularity.moduleplugin.tasks.CompileTestTask$1.execute(CompileTestTask.java:39)
	at org.javamodularity.moduleplugin.tasks.CompileTestTask$1.execute(CompileTestTask.java:36)
	at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:749)
	at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:722)
@koppor
Copy link

koppor commented Apr 12, 2021

Adapting xtext/xtext-gradle-plugin#4 (comment), the following could be a work around?

configurations {
  testCompile {
    extendsFrom testImplementation
  }
}

@siordache
Copy link
Collaborator

I plan to make a new release of the gradle-modules-plugin in the next few days, which should fix this issue.

@JamesXNelson
Copy link

Pinging thread to get a notification when closed. tyvm for working on this.

@siordache
Copy link
Collaborator

I just released gradle-modules-plugin 1.8.0 and also submitted a pull request for using this version with the javafx-gradle-plugin.

@Siedlerchr
Copy link
Author

Siedlerchr commented Apr 26, 2021

I just tested the version 1.8.0 and now get an NPE:

 Cannot invoke "String.matches(String)" because "groupId" is null
Caused by: java.lang.NullPointerException: Cannot invoke "String.matches(String)" because "groupId" is null
        at org.javamodularity.moduleplugin.TestEngine.lambda$select$1(TestEngine.java:71)
        at org.javamodularity.moduleplugin.TestEngine.selectMultiple(TestEngine.java:63)
        at org.javamodularity.moduleplugin.tasks.CompileTestTask.buildCompilerArgs(CompileTestTask.java:71)
        at org.javamodularity.moduleplugin.tasks.CompileTestTask$1.execute(CompileTestTask.java:44)
        at org.javamodularity.moduleplugin.tasks.CompileTestTask$1.execute(CompileTestTask.java:41)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:749)

Test configuraiton looks like:

test {
    useJUnitPlatform {
        excludeTags 'DatabaseTest', 'FetcherTest', 'GUITest'
    }

    moduleOptions {
        // TODO: Remove this as soon as archunit is modularized
        runOnClasspath = true
    }

    testLogging {
        // set options for log level LIFECYCLE
        // for debugging tests: add "STANDARD_OUT", "STANDARD_ERROR"
        events = ["FAILED"]
        exceptionFormat "full"
    }
}

@siordache
Copy link
Collaborator

Fixed in 1.8.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants