Closed mklueh closed 2 years ago
Hi @mklueh.
Remove the manifold-ext in your implementatoin dependencies. In your case, manifold-ext is implicitly used through manifold-csv as an annotationProcessor path. It should not be used as an implementation dep. Also, since you are using testImplementation.extendsFrom annotationProcessor
, you can eliminate all the test related dependencies too.
dependencies {
implementation "systems.manifold:manifold-csv-rt:${manifoldVersion}"
implementation "systems.manifold:manifold-science:${manifoldVersion}"
annotationProcessor "systems.manifold:manifold-csv:${manifoldVersion}"
}
@rsmckinney thanks.
First of all, I always have another problem that the class seems to be not generated and I have to rename the csv file to trigger the annotation processor again in order to make the IDE recognize the file.
As for the actual problem, I tried it the other way around first by removing testImplementation.extendsFrom annotationProcessor
and just having these in place:
implementation "systems.manifold:manifold-csv-rt:${manifoldVersion}"
testImplementation "systems.manifold:manifold-csv-rt:${manifoldVersion}"
annotationProcessor "systems.manifold:manifold-csv:${manifoldVersion}"
testAnnotationProcessor "systems.manifold:manifold-csv:${manifoldVersion}"
It leads to package com.mypackage.MyCsvClass does not exist
when running the test. The IDE however does not complain and finds the package.
When I have the other solution in place
implementation "systems.manifold:manifold-csv-rt:${manifoldVersion}"
//testImplementation "systems.manifold:manifold-csv-rt:${manifoldVersion}"
annotationProcessor "systems.manifold:manifold-csv:${manifoldVersion}"
//testAnnotationProcessor "systems.manifold:manifold-csv:${manifoldVersion}"
together with
configurations {
// give tests access to annotationProcessor dependencies
testImplementation.extendsFrom annotationProcessor
}
I get
error: plug-in not found: Manifold
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':my-application-core:compileTestJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Currently, I'm using Gradle 6.9.2
I've configured a similar project locally and it works okay here. Any chance your project is available on github or similar so I can help configure it?
@rsmckinney also a multi-module project with Gradle?
I try to create a reproducer
@rsmckinney I've created one, with just one module but still having the same problem
https://github.com/mklueh/spring-gradle-multi-module-manifold-reproducer
There are three screenshots of things that happen one after another. When 3. happens, I need to rename the csv file or delete and recreate it
@mklueh Looks like the problem is simply that TestData.csv
is in resources/com.example/
. Should be in resources/com/example/TestData.csv
. I feel like IntelliJ should warn about creating a resource directory with a dot in it. Anyhow, should be a simple fix on your end.
@rsmckinney you are right with that, however the problem still exists. Have you managed to get it working with my reproducer?
@mklueh Yes, that is the only change that was necessary. Works fine for me.
@mklueh Ok, I do have an issue after I built on the command line. Looking at this now.
Looks like an issue with the testImplementation.extendsFrom annotationProcessor
trick. I don't think that works quite the way it's intended. If I remove that and add the testAnnotationPrcoessor for csv, it works fine. However, I had to muck with the spring boot stuff; it didn't work as it was setup. Here are the significant changes:
dependencies {
implementation "org.springframework.boot:spring-boot-starter"
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
implementation "systems.manifold:manifold-csv-rt:${manifoldVersion}"
//## UNNECESSARY, tests inherit implementation dependencies
// testImplementation "systems.manifold:manifold-csv-rt:${manifoldVersion}"
annotationProcessor "systems.manifold:manifold-csv:${manifoldVersion}"
//## ADDED
testAnnotationProcessor "systems.manifold:manifold-csv:${manifoldVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-params:${junitVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-engine:${junitVersion}"
testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}"
}
tasks.withType(JavaCompile) {
options.compilerArgs += ['-Xplugin:Manifold']
}
configurations {
all {
//noinspection GroovyAssignabilityCheck
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
}
//## REMOVE
// // give tests access to annotationProcessor dependencies
// testImplementation.extendsFrom annotationProcessor
}
changes work locally, please reopen if your issue persists, thanks
Hello,
I'm really glad I've discovered this amazing project, but I'm running into a weird error with manifold and I cannot get it working at all. The project is a multi-module Gradle setup and I'm using manifold version 2022.1.9
TestCsv.csv
root build.gradke
Leads to this error
Would appreciate any help.