apache / apache/maven-release

[MRELEASE-1131] When preparing a release on Windows 10, the pom.xml is not read properly when building the code

Open
#1,310 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
128
Forks
145
Avg merge
7h 7m
Merged PRs (30d)
3

Description

**[Robert Voorn](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=JIRAUSER301057)** opened **[MRELEASE-1131](https://issues.apache.org/jira/browse/MRELEASE-1131?redirect=false)** and commented

I created a project on a Macbook Pro laptop that uses the Maven Release Plugin (tried with 2.5.3 and 3.0.1) and works as desired and documented. However, when I clone this project on a Windows 10 machine and to the same 'mvn release:prepare' command, it behaves differently. It will do the checks regarding -SNAPSHOT should be in the version, the new release version is suggested and can be modified, the tag name is suggested and can be modified, and the new SNAPSHOT version is suggested and can be modified. After that, on Macbook it will the package maven goal (as configured in the plugin). On Windows I get the following error:

```
The goal you specified requires a project to execute but there is no POM in this directory (C:\). Please verify you invoked Maven from the correct directory.
```

It looks like when the release:prepare goal is executed on the maven project, it first can read it (hence the version suggestions are correct) but when the 'package' goal is executed after that it tries to find the pom.xml in my home folder (when the maven command is not executed and the pom.xml is indeed not present.

I also tried to explicitly give the full path to the pom.xml file using the -f option and that also does not work.

The plugin configuration is as follows:

```xml

org.apache.maven.plugins
maven-release-plugin

pre-integration-test
package
true
v@{project.version}
false

```

I use the following spring-boot-starter-parent:

```xml

org.springframework.boot
spring-boot-starter-parent
2.5.8

```

Is there something that needs to change when using this plugin in Windows instead of Macbook?

On windows I use the git-bash linux shell application to run the maven command. The problem also happens using the regular cmd.exe from windows (even when running with administrator rights). The Windows 10 machine I am working on is a restricted virtual machine, but should have full administrative rights when the cmd.exe is started as adminitrator. I am convinced that the configuration is correct since it works fine on Macbook. Maybe someone can point out some differences that are happening on Linux based machines and Windows 10. I have tried to find some solutions using google and these solutions do not work.

 

---
No further details from [MRELEASE-1131](https://issues.apache.org/jira/browse/MRELEASE-1131?redirect=false)

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the Maven Release Plugin's release:prepare flow on Windows 10 using the reported pom.xml configuration, first comparing Git Bash and cmd.exe and then checking the -f behavior. Focus on the transition to the package preparation goal, where Maven looks in the home directory instead of the project directory. Done means the configured preparation goal locates the pom.xml and completes consistently on Windows and macOS.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.