Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<compileArgs> in maven-plugin configuration whitespace issue #434

Open
mands opened this issue Mar 5, 2025 · 0 comments
Open

<compileArgs> in maven-plugin configuration whitespace issue #434

mands opened this issue Mar 5, 2025 · 0 comments

Comments

@mands
Copy link

mands commented Mar 5, 2025

Hi,

I'm trying to enable several compileArgs as part of configuration for the maven plugin. It works when there is only a single flag without spaces, but any spaces seem to break how the contents is passed to javac.

Working example

The below adds only --enable-preview as a compileArg and works.

            <plugin>
                <groupId>gg.jte</groupId>
                <artifactId>jte-maven-plugin</artifactId>
                <version>${jte.version}</version>
                <configuration>
                    ... 
                    <compileArgs>--enable-preview</compileArgs>
                </configuration>
            </plugin>

Error example

            <plugin>
                <groupId>gg.jte</groupId>
                <artifactId>jte-maven-plugin</artifactId>
                <version>${jte.version}</version>
                <configuration>
                    ... 
                    <compileArgs>--enable-preview --release 23</compileArgs>
                </configuration>
            </plugin>

The above fails with the following error,

[ERROR] Failed to execute goal gg.jte:jte-maven-plugin:3.1.16:precompile (default) on project backend: Execution default of goal gg.jte:jte-maven-plugin:3.1.16:precompile failed: Failed to compile template, error at
[ERROR] error: invalid flag: --enable-preview --release 23
[ERROR] Usage: javac <options> <source files>
[ERROR] use --help for a list of possible options

I've tried adding xml:space="preserve" as an attribute tag but it makes no difference, e.g.

<compileArgs xml:space="preserve">--enable-preview --release 23</compileArgs>

Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant