Skip to content

Destination file overwritten even with overwrite false in 3.4.0 #453

@neilcsmith-net

Description

@neilcsmith-net

Affected version

3.4.0

Bug description

This is based on an issue reported by a NetBeans platform developer (and PMC member). When resources plugin is upgraded to 3.4.0, a project was seen to fail if calling eg. mvn test subsequently to a clean build. In certain circumstances, a copied resource is altered later in the build. With 3.4.0 the original resource is copied back over the top, but the additional step (in this case a resource bundle in annotation processing during compilation) is not triggered, leaving an invalid and broken build.

The overwrite flag is documented as "Overwrite existing files even if the destination files are newer." (emphasis mine). This implies that the default behaviour should still be to not overwrite a newer destination file. Any NetBeans platform build with Maven is potentially relying on this behaviour, that the destination file is not overwritten if it has been changed by a later stage of the build. The change that introduced this seems to suggest that flag would also be deprecated, but it doesn't seem to be?? Is there another way of ensuring existing destination files are not overwritten?

I realise that overwriting existing resources in an annotation processor is something of a grey area. Unfortunately, it's something we're probably stuck with.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions