apache / apache/maven-wrapper

WARNING: A restricted method in java.lang.System has been called

Open
#410 2 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Java
Stars
254
Forks
78
Avg merge
5h 26m
Merged PRs (30d)
2

Description

### Affected version

3.9.14

### Bug description

Following https://github.com/apache/maven/issues/11900

I'm getting the warning with Maven wrapper

- OS: Windows
- JDK: 25
- Wrapper: `mvn wrapper:wrapper -Dtype=source`

It only fails when using the wrapper.

### Maven

```shell
> mvn -v
Apache Maven 3.9.14 (996c630dbc656c76214ce58821dcc58be960875b)
Maven home: C:\Program Files\Maven\apache-maven-3.9.14
Java version: 25.0.2, vendor: Eclipse Adoptium, runtime: C:\Program Files\Eclipse Adoptium\jdk-25.0.2.10-hotspot
Default locale: en_US, platform encoding: UTF-8
OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"
```

### Maven Wrapper

```shell
> ./mvnw -v
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by org.fusesource.jansi.internal.JansiLoader in an unnamed module (file:/C:/Users//.m2/wrapper/dists/apache-maven-3.9.14-bin/5d54584a/apache-maven-3.9.14/lib/jansi-2.4.2.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

Apache Maven 3.9.14 (996c630dbc656c76214ce58821dcc58be960875b)
Maven home: C:\Users\\.m2\wrapper\dists\apache-maven-3.9.14-bin\5d54584a\apache-maven-3.9.14
Java version: 25.0.2, vendor: Eclipse Adoptium, runtime: C:\Program Files\Eclipse Adoptium\jdk-25.0.2.10-hotspot
Default locale: en_US, platform encoding: UTF-8
OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the warning with ./mvnw -v on Windows using JDK 25, then compare it with mvn -v and the Maven wrapper generated by mvn wrapper:wrapper -Dtype=source. Start at the wrapper entry point and the bundled jansi-2.4.2.jar mentioned in the output; done means the wrapper no longer emits the restricted native-access warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.