redhat-developer / redhat-developer/vscode-java
vscode generates compile errors for valid test-jar dependencies
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- TypeScript
- Estrellas
- 2.3k
- Forks
- 546
- Merge medio
- 20 h 1 min
- PR fusionados (30 d)
- 11
Descripción
I have a non shipping "utility" maven module. It has a dependency on classes from a test-jar produced by another module. If both the utility maven module and the test-jar producing module are loaded in the workspace, vscode generates compile errors for all imported test-jar classes. See the first screenshot below. Note that the compile errors in vscode are incorrect and should not exist. In contrast, running "mvn clean install" results in a successful build and IntelliJ handles this situation fine (there are no compile errors).
If however the module that produces the test jar is not loaded in the workspace, there are no compile errors for the imported test-jar classes in vscode. See the second screenshot below. In otherwords, the compile error only shows up when the test-jar producing module is in the workspace with the test-jar consuming module. Apparently vscode/eclipse jdt cannot resolve the test classes when they are from a local project and imported by another project's src/main classes.
I will attach 2 small maven projects to demonstrate the problem. You can load them into vscode to reproduce. You can also build them from the command line with mvn to confirm they are valid.
Compile error when both test-jar consuming and producing projects are in the workspace
No compile error when the test-jar producing project is not in the workspace
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza abriendo test-jar-issue-projects.zip en VS Code con ambos proyectos Maven cargados y, después, compara los diagnósticos con un workspace que contenga únicamente el proyecto consumidor. Ejecuta mvn clean install para confirmar que los proyectos son válidos; la tarea está completada cuando las importaciones locales de test-jar ya no producen errores de compilación falsos cuando ambos proyectos están presentes.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java
- Área
- devtools
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100