maven-compiler-plugin icon indicating copy to clipboard operation
maven-compiler-plugin copied to clipboard

A non-deprecated path to set a compiler option

Open eric-maziade-tac opened this issue 3 months ago • 0 comments

New feature, improvement proposal

I'm using the latest 3.x maven compiler plugin.

I need a non-deprecated path to set a compiler option - in this case, -properties= to ecj.

We're currently using <compilerArguments> to pass the -properties= compiler argument to ecj - this is currently the only path to get a key=value compiler custom argument.

Since this method is deprecated, no paths are left to set free form arguments to the compiler (we can get to key=null or key=value=null - which does not work in this case)

I'm looking for a valid path to get the compiler argument in without challenging the decision to deprecate compilerArguments.

The solution I am proposing (for which I have a working solution, if the idea floats) - is to add <compilerPropertiesFile> to the Compiler Mojo.

If specified, that would get passed along as the -properties compiler argument. Its straightforward, but its specific for ecj, so I don't really like it all that much.

The more abstract designs I can think of really is just the same as either re-implementing compilerArguments with a different name... or just not deprecate it.

For context, we have a long list of ecj compiler properties that are reused and maintained through multiple projects and tools - it is, by far, the simplest method for us to manage these.

eric-maziade-tac avatar Sep 18 '25 15:09 eric-maziade-tac