mojohaus / mojohaus/exec-maven-plugin

Shell script execution using "basedir" as argument has problems in Windows

Open
#400 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
191
Forks
111
Avg merge
1d 21h
Merged PRs (30d)
4

Description

When using the exec-maven-plugin within a pom.xml to run a bash script located in the basedir (Windows) as follows:

<configuration>
     <executable>bash</executable>
     <arguments>
         <argument>${basedir}/scripts/script.sh</argument>
         <argument>${version}</argument>
     </arguments>
</configuration>

the parsed path when the plugin executes seems to be incorrect, the entire basedir appears without slashes, as follows:

C:UsersUsernameWhateverDirectories/scripts/script.sh

When it should be like

C:Users/Username/Whatever/Directories/scripts/script.sh

This is something that happens also for other people, so seems to be a bug in the plugin for Windows systems.
I would say this has something to be with the parsing of the escaped values (\) in the plugin itself, but I didn't go further on this investigation.

The rest of plugins and values that use the ${basedir} parameter work totally fine.
In Linux/Mac systems there's no problems.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the exec-maven-plugin configuration from the issue on Windows with bash and scripts/script.sh, using ${basedir} as the argument. Trace how the pom.xml argument path is parsed and compare it with Linux or macOS behavior; done means the basedir path retains its separators when the script executes on Windows.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, java
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.