Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2e-dev] Project build is not triggered after refresh

Hello everyone!

I have a bunch of connectors [1]. Since some time ago, they are used by a big team, and I started receiving complaints. I reproduced the problem with the test project for the cxf-xjc-plugin connector [2]:

1. Import the project. Everything is fine after import.
2. Select Project/Clean. At this point, connector deletes generated files, refreshes the target folders, generates new files, and refreshes the target folders again. The generated Java files are correctly refreshed and visible in Eclipse, but the incremental build is not triggered and the files are not compiled. The DependsOnGenerated class, which depends on generated Java classes, displays errors like "class cannot be resolved to a type" and "import cannot be resolved". On rare occasions the generated files are recompiled, but in most cases the problem is reproducible.
3. Refresh the project manually. The generated files are compiled and all errors go away.

I played a bit with the antlr-maven-plugin connector and one of its test projects [3]. The problem is not so visible, because it does not delete generated files on clean. But it's still possible to reproduce:

1. Do mvn clean in command line.
2. Do Project/Clean - the files are generated and refreshed, but the Sample class has errors.
3. Refresh the project - errors are gone.

Tested with Eclipse Kepler and Kepler SR1. Complaints came from the team working on STS based on Eclipse 3.8. The problem is not reproducible if Maven Project Builder is configured before the Java Builder, but when Maven project configuration is updated, Java Builder is put again at the top.

I found a bug which may be related [4]. Is this a known problem? Is there a workaround for it?

[1] https://github.com/htfv/m2e-connectors
[2] https://github.com/htfv/m2e-connectors/tree/develop/cxf-xjc/com.github.htfv.m2e.connectors.cxfxjc.tests/test-projects/xsdtojava
[3] https://github.com/tesla/m2eclipse-antlr/tree/master/org.sonatype.m2e.antlr.tests/projects/antlr/antlr-p001
[4] https://bugs.eclipse.org/bugs/show_bug.cgi?id=58649

Regards,
htfv (Aliaksei Lahachou)

Back to the top