spotless-maven-plugin fails with "No valid license found" when using IntelliJ IDEA Ultimate

Open
#2,544 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start with the spotless-maven-plugin IntelliJ formatter integration and the command invocation shown in the issue, then compare it with IntelliJ's working format.sh invocation on macOS. Reproduce with IntelliJ IDEA Ultimate 2025.1.1 and the supplied Maven configuration; done means Maven formatting can use the active license, or the limitation and supported workaround are documented.

Written by the indexing model from the issue text.

Description

Hi Spotless team 👋

Description:

I'm using the spotless-maven-plugin (version 2.45.0-SNAPSHOT) with the IntelliJ IDEA formatter integration on macOS (I'm using 2.45.0-SNAPSHOT, built locally, since there hasn't been a stable release yet that includes IntelliJ (idea) support for Maven.). My IntelliJ version is:

IntelliJ IDEA 2025.1.1 (Ultimate Edition)

Even though my license is active and the IDE is registered properly (I can use IntelliJ with no issue via GUI), running mvn spotless:check fails with the following error:

> arguments: [/Users/ozlemulag/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea, format, -s, /Users/ozlemulag/Applications/ozlemulag/Documents/codestyle_settings.xml, -charset, UTF-8, /private/var/...Temp.java]
> exit code: 7
> stdout: No valid license found
> stderr:
> [JRSAppKitAWT markAppIsDaemon] failed. SetApplicationIsDaemon returned -50
> WARN - CommonProxy - main authenticator is not yet registered

Here's my relevant Maven configuration:

<plugin>
  <groupId>com.diffplug.spotless</groupId>
  <artifactId>spotless-maven-plugin</artifactId>
  <version>2.45.0-SNAPSHOT</version>
  <executions>
    <execution>
      <goals>
        <goal>check</goal>
        <goal>apply</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <java>
      <includes>
        <include>src/**/*.java</include>
      </includes>
      <idea>
        <codeStyleSettingsPath>/Users/ozlemulag/Documents/codestyle_settings.xml</codeStyleSettingsPath>
        <withDefaults>false</withDefaults>
        <binaryPath>/Users/ozlemulag/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea</binaryPath>
      </idea>
    </java>
  </configuration>
</plugin>

Additional Notes:
If I run the formatter manually using format.sh like this:

find -name "*.java" -print0 | xargs -0 /Users/ozlemulag/Applications/IntelliJ\ IDEA\ Ultimate.app/Contents/bin/format.sh -s /Users/ozlemulag/Documents/codestyle_settings.xml

…then everything works fine. Formatting is applied successfully to all files.

It seems that when Spotless invokes IntelliJ, it is unable to detect the active license.

Question:
Is this a known limitation?
Is there a way to allow Spotless to access the IntelliJ license when running via Maven/CLI?

Thanks a lot in advance 🙏
Let me know if you'd like me to try with any debugging flags or extra settings.

Dominant language
Java
Stars
5.7k
Forks
560
Avg merge
1d 13h
Merged PRs (30d)
43

Contributor guide

Open the contributing guide

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.

More from diffplug/spotless

All issues in diffplug/spotless

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.