apache / apache/maven-compiler-plugin
[MCOMPILER-372] Unable to compile modularized test code depending on test-jar
- Dominant language
- Java
- Stars
- 261
- Forks
- 191
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 8
Description
**[Jeronimo Backes](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=jeronimobackes)** opened **[MCOMPILER-372](https://issues.apache.org/jira/browse/MCOMPILER-372?redirect=false)** and commented
I'm refactoring [univocity-parsers](https://github.com/uniVocity/univocity-parsers) into multiple projects with modules (attached a zip with everything I got)
However I'm unable to reliably build the attached project with its unit tests. Unpack then cd into "univocity-all-parent", then run "mvn clean install".
All projects generate test-jars, but for some reason class **com.univocity.parsers.core.routine.ResultSetWritingRoutine** inside "univocity-parsers-core/src/test/java/" is not found when compiling the tests of projects "univocity-csv", "univocity-tsv" and "univocity-fixedwidth".
Interestingly, the issue doesn't seem to be consistent as I got "univocity-csv" and "univocity-tsv" building without errors a few times. "univocity-fixedwidth" however failed consistently every single time.
Some of the errors I get are:
`[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:testCompile (default-testCompile) on project univocity-csv: Compilation failure: Compilation failure: `
`[ERROR] /home/jbax/dev/repository/univocity-all/univocity-oss/univocity-csv/src/test/java/com/univocity/csv/CsvWriterTest.java:[27,49] cannot find symbol`
`[ERROR] symbol: class ResultSetWritingRoutine`
`[ERROR] location: package com.univocity.parsers.core.routine`
`[ERROR] /home/jbax/dev/repository/univocity-all/univocity-oss/univocity-csv/src/test/java/com/univocity/csv/CsvWriterTest.java:[681,17] cannot find symbol`
`[ERROR] symbol: class ResultSetWritingRoutine`
`[ERROR] location: class com.univocity.csv.CsvWriterTest`
`[ERROR] /home/jbax/dev/repository/univocity-all/univocity-oss/univocity-csv/src/test/java/com/univocity/csv/CsvWriterTest.java:[681,52] cannot find symbol`
`[ERROR] symbol: class ResultSetWritingRoutine`
`[ERROR] location: class com.univocity.csv.CsvWriterTest`
`[ERROR] /home/jbax/dev/repository/univocity-all/univocity-oss/univocity-csv/src/test/java/com/univocity/csv/CsvWriterTest.java:[691,17] cannot find symbol`
`[ERROR] symbol: class ResultSetTest`
`[ERROR] location: class com.univocity.csv.CsvWriterTest`
`[ERROR] /home/jbax/dev/repository/univocity-all/univocity-oss/univocity-csv/src/test/java/com/univocity/csv/CsvWriterTest.java:[691,45] cannot find symbol`
`[ERROR] symbol: class ResultSetTest`
`[ERROR] location: class com.univocity.csv.CsvWriterTest`
`[ERROR] /home/jbax/dev/repository/univocity-all/univocity-oss/univocity-csv/src/test/java/com/univocity/csv/routine/CsvRoutinesTest.java:[123,17] cannot find symbol`
`[ERROR] symbol: class ResultSetWritingRoutine`
`[ERROR] location: class com.univocity.csv.routine.CsvRoutinesTest`
`[ERROR] /home/jbax/dev/repository/univocity-all/univocity-oss/univocity-csv/src/test/java/com/univocity/csv/routine/CsvRoutinesTest.java:[123,52] cannot find symbol`
`[ERROR] symbol: class ResultSetWritingRoutine`
`[ERROR] location: class com.univocity.csv.routine.CsvRoutinesTest`
`[ERROR] /home/jbax/dev/repository/univocity-all/univocity-oss/univocity-csv/src/test/java/com/univocity/csv/routine/CsvRoutinesTest.java:[124,68] package ResultSetWritingRoutine does not exist`
I was also getting errors saying that the "Example" class was not found, or that the "printAndValidate" method was not found (that one comes from the univocity-output-tester dependency)..
There's something very weird going on and it's not consistently reproducible. If you for example change the code in the failing tests use "**import static com.univocity.parsers.core.routine.ResultSetWritingRoutine.*** " you may get a different set of errors. It's pretty intractable.
I hope this provides enough information, let me know if you need anything else.
---
**Affects:** 3.8.0
**Attachments:**
- [maven-compiler-plugin.MCOMPILER-372.patch](https://issues.apache.org/jira/secure/attachment/12985966/maven-compiler-plugin.MCOMPILER-372.patch) (_1.68 kB_)
- [univocity-all.zip](https://issues.apache.org/jira/secure/attachment/12958335/univocity-all.zip) (_912.77 kB_)
**Issue Links:**
- [MCOMPILER-429](https://issues.apache.org/jira/browse/MCOMPILER-429) CLONE - Unable to compile modularized test code depending on test-jar
(_**"is cloned by"**_)
- [MCOMPILER-429](https://issues.apache.org/jira/browse/MCOMPILER-429) CLONE - Unable to compile modularized test code depending on test-jar
(_**"is duplicated by"**_)
**Remote Links:**
- [GitHub Pull Request #27
](https://github.com/apache/maven-compiler-plugin/pull/27)
0 votes, 5 watchers
Contributor guide
No contributing guide indexed for this repository
Research direction
Unpack univocity-all.zip, enter univocity-all-parent, and run mvn clean install to reproduce the failure. Start with the maven-compiler-plugin.MCOMPILER-372.patch and the test sources named in univocity-csv, univocity-tsv, and univocity-fixedwidth. Done means the modularized test code compiles reliably, including ResultSetWritingRoutine and the other reported test dependencies.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100