querydsl / apt-maven-plugin

Maven APT plugin
Apache License 2.0
79 stars 41 forks source link

outputDirectory not cleaned during incremental updates or project clean in Eclipse #15

Open benze opened 11 years ago

benze commented 11 years ago

I don't know if this is a plugin issue, a configuration issue, or just plain not feasible. But I've noticed that when I make changes to my classes the plugin will make incremental changes to the Q-classes. That is great.

However, if I clean the project, then all the generated files in the outputDirectory remain. Furthermore, if I refactor a classname, the old Q-class remains even though the new Q class is generated as well. I can, of couse, clean the outputDirectory by issuing: mvn clean

I currently have my outputDirectory configured as:

target/generated-sources/apt

Is this a configuration issue on my behalf, or if it is an issue in the plugin.

I'm using m2e 1.2, and plugin 1.0.7.

Thanks,

Eric

timowest commented 11 years ago

However, if I clean the project, then all the generated files in the outputDirectory remain. Furthermore, if I refactor a classname, the old Q-class remains even though the new Q class is generated as well.

I wil take a look if this can be better handled for IDE based builds.

benze commented 11 years ago

I also noticed in refactoring a class name, that although the new QClass is properly generated, all code still refers to the old Q class. I don't know if there would be a way to indicate to Eclipse that the Q class' name is being changed by the Entity class name change and to include it in the refactor process.

timowest commented 11 years ago

It's possible to get the deleted source in the plugin but I don't yet how to get access to the generated files.

luisfpg commented 10 years ago

I have worked-around this by creating a new Ant builder in the Eclipse project, and made it delete every generated sources in a given target. Then, in the builder Targets tab, select that target's name in the During a Clean field. Then, any Project > clean will properly remove and trigger the re-generation of those files.

timowest commented 10 years ago

@benze Could you also try this pull request https://github.com/querydsl/apt-maven-plugin/pull/27

It populates the output directory now in a smarter way.

benze commented 10 years ago

I've been moved onto another project at the moment (which is much different technology), so wouldn't be of much help validating the plugin at the moment. As soon as I get a chance to get back to a QDSL project, I'll give it a shot.

Thx!

Eric

On Sat, Oct 11, 2014 at 9:58 AM, Timo Westkämper notifications@github.com wrote:

@benze https://github.com/benze Could you also try this pull request #27 https://github.com/querydsl/apt-maven-plugin/pull/27

It populates the output directory now in a smarter way.

— Reply to this email directly or view it on GitHub https://github.com/querydsl/apt-maven-plugin/issues/15#issuecomment-58750347 .