Skip to content

Empty argument tag may not pass empty string on Windows #471

@tisonkun

Description

@tisonkun

I wonder if Windows performs differently in this case. See apache/opendal#6059 (comment)

We have:

<properties>
  <cargo-build.target/>
</properties>
<plugin>
    <artifactId>exec-maven-plugin</artifactId>
    <groupId>org.codehaus.mojo</groupId>
    <version>${exec-maven-plugin.version}</version>
    <executions>
        <execution>
            <id>compile-native-code</id>
            <phase>compile</phase>
            <goals>
                <goal>exec</goal>
            </goals>
            <configuration>
                <executable>python3</executable>
                <arguments>
                    <argument>${project.basedir}/tools/build.py</argument>
                    <argument>--target</argument>
                    <argument>${cargo-build.target}</argument>
                </arguments>
            </configuration>
        </execution>
    </executions>
</plugin>

This works on my Linux and macOS platform, but seems when running with mvnw.cmd on Windows, it doesn't work:

[INFO] --- exec:3.1.0:exec (compile-native-code) @ opendal ---
usage: build.py [-h] --classifier CLASSIFIER [--target TARGET]
                [--profile PROFILE] [--features FEATURES]
                [--enable-zigbuild ENABLE_ZIGBUILD]
build.py: error: argument --target: expected one argument
[ERROR] Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 2 (Exit value: 2)

Originally posted by @tisonkun in #150 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions