FAQ
Invalid entry compressed size exception
We've seen this a few times and suspect it's the result of an underlying bug in the JDK.
To fix this, please:
- Ensure that you're running a more recent JDK (or, at least, the latest patch release of your JDK of choice).
- Remove the
~/.m2/repository/io/modernedirectory.
After you've done both, re-run the command you were attempting.
Could not find artifact io.moderne:modmaven:jar in Artifactory
We suspect this is the same issue as the invalid entry compressed size exception and suggest performing the same steps to try and resolve.
If you look in your Maven home directory (~/.m2/repository/io/moderne/modmaven), you will likely see a modmaven-*.jar file. However, it is likely that the JAR is corrupted due to the JDK bug mentioned above.
Issues with cloning repositories with deep file paths
On Windows machines, you may run into issues cloning repositories with deep file paths. To fix this, try running the following command:
git config --system core.longpaths true
Parse errors while building
If you run into parse errors while building, please run the org.openrewrite.FindParseFailures recipe. This will produce a data table that contains a row for each parse failure.
To run this recipe and generate this data table with the CLI, please run the following command:
mod run . --recipe FindParseFailures
mod study . --last-recipe-run --data-table org.openrewrite.table.ParseFailures
Failed to apply patch: Cannot apply: HunkHeader
If you experience this issue when running mod git apply, please try committing/stashing/reverting the unsaved changes before running mod git apply again.
If that doesn't work, and you keep running into issues with this, please contact support@moderne.io and provide us with the fix.patch file and the target files (ideally reduced to the minimum need to replicate the issues).
My project only builds resources, not my Maven or other build
If you see Step 1 - build resources, then we did not detect any other build tools. Your output would look something like:
> some-org/some-repository@develop
Build output will be written to file:///Users/you/Documents/some-repository/.moderne/build/20240917092838-mt6Ew/build.log
> Step 1 - build resources
+ Built LST file:///Users/you/Documents/some-repository/.moderne/build/20240917092838-mt6Ew/some-repository-20240917092845-ast.jar
+ Reported build metrics to Moderne
+ Cleaned 1 older builds.
If your project does contain a pom.xml file (or similar), then you might want to double-check that your .gitignore file does not exclude it.
The CLI skips any resources marked as Git ignored during project discovery, and remove the matching entry from .gitignore if present.
I need to enter an SSH passphrase to check out repositories – how does the CLI handle this?
Check out our SSH keys with passphrases guide.
How can I inspect the current configuration of the CLI?
All configuration is stored in ~/.moderne/cli/moderne.yml and can be inspected there.
Can I run multiple CLI commands at once?
No. The CLI was not designed to run multiple commands simultaneously.
HTTP 401 errors during recipe execution on Gradle projects
Gradle and OpenRewrite use separate authentication mechanisms for dependency resolution. During mod build, Gradle resolves dependencies using the credentials in your build.gradle file. During mod run, however, recipes that need to resolve new dependency versions (e.g., for a Spring Boot upgrade) go through OpenRewrite's own Maven-based resolution. This resolution uses the repository URLs captured in the LST but does not have access to your Gradle credentials — resulting in HTTP 401 errors.
To fix this, you should create a Maven settings.xml file with your repository credentials and point the CLI at it:
mod config build maven settings edit /path/to/settings.xml
Your settings.xml file should contain server credentials that match your repository. For example:
<settings>
<servers>
<server>
<id>my-artifactory</id>
<username>${env.ARTIFACTORY_USER}</username>
<password>${env.ARTIFACTORY_PASSWORD}</password>
</server>
</servers>
<profiles>
<profile>
<id>default</id>
<repositories>
<repository>
<id>my-artifactory</id>
<url>https://your-artifactory-url/</url>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>default</activeProfile>
</activeProfiles>
</settings>
The <server><id> must match the <repository><id>. The repository URL should match what is declared in your build.gradle file. Environment variables (${env.VAR_NAME}) and system properties (${prop.name}) are supported in server credentials.
This configuration is used as a universal credential format for dependency resolution at recipe execution time, regardless of whether your project uses Maven or Gradle.