Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.
jpm is a Java 11+ Maven-based command line tool for managing Maven dependencies in non-Maven/Gradle Java projects. It creates symbolic links to dependencies and manages app.yml configuration files.
- CRITICAL: Make mvnw executable first:
chmod +x mvnw - Build and format code:
./mvnw spotless:apply clean install- NEVER CANCEL: Takes ~35 seconds. Set timeout to 120+ seconds.
- Quick rebuild after changes:
./mvnw clean verify- NEVER CANCEL: Takes ~5 seconds. Set timeout to 60+ seconds.
- CI build with release assembly:
./mvnw -B verify jreleaser:assemble -Prelease- NEVER CANCEL: Takes ~32 seconds. Set timeout to 120+ seconds.
- ALWAYS run formatting before committing:
./mvnw spotless:apply- Takes ~2 seconds. Required for CI to pass.
- Check formatting only:
./mvnw spotless:check - ALWAYS run
./mvnw spotless:applybefore making any commits or the CI (.github/workflows/ci.yml) will fail.
- No unit tests exist - the Maven test phase skips with "No tests to run"
- Run jpm using the binary distribution:
./target/binary/bin/jpm [commands] - Run jpm using the CLI jar:
java -jar target/jpm-0.4.1-cli.jar [commands]
Always manually validate jpm functionality after making changes:
- Build the project:
./mvnw spotless:apply clean install - Test help:
./target/binary/bin/jpm --help - Test version:
./target/binary/bin/jpm --version - Create test directory:
mkdir -p /tmp/jpm-test && cd /tmp/jpm-test - Test copy functionality:
[repo-path]/target/binary/bin/jpm copy com.github.lalyos:jfiglet:0.0.9- Verify: Creates
deps/directory with symlink to jar
- Verify: Creates
- Test install functionality:
[repo-path]/target/binary/bin/jpm install com.github.lalyos:jfiglet:0.0.9- Verify: Creates
app.ymlfile with dependency entry
- Verify: Creates
- Test path command:
[repo-path]/target/binary/bin/jpm path- Verify: Outputs classpath to dependency jars
- Test complete Java workflow:
// Create HelloWorld.java import com.github.lalyos.jfiglet.FigletFont; public class HelloWorld { public static void main(String[] args) throws Exception { System.out.println(FigletFont.convertOneLine("Hello, World!")); } }
- Run:
java -cp "deps/*" HelloWorld.java - Verify: ASCII art output is displayed correctly
- Run:
- The
jpm searchcommand may fail with YAML parsing errors in some network environments - This is a known limitation, focus testing on copy, install, and path commands
target/jpm-0.4.1.jar- Main jar (not standalone)target/jpm-0.4.1-cli.jar- Standalone executable jar (~5.8MB)target/binary/bin/jpm- Executable shell scripttarget/binary/lib/- All dependency jars for distribution
- For users: Use
target/jpm-0.4.1-cli.jarortarget/binary/directory - For development: Use
./target/binary/bin/jpmfor testing
src/main/java/org/codejive/jpm/- Main source codeMain.java- CLI entry point with PicoCLI commands (Copy, Search, Install, PrintPath)Jpm.java- Core business logic for artifact resolution and managementutil/- Utility classes (FileUtils, ResolverUtils, SearchUtils, etc.)json/- AppInfo class for app.yml file handling
.github/workflows/ci.yml- CI pipeline (build + jreleaser assembly)jreleaser.yml- Release configurationpom.xml- Maven build configuration
pom.xml- Maven configuration with Spotless formatting, Shade plugin, Appassemblerapp.yml- jpm's actual runtime dependencies and actions (NOT an example file). Dependencies should be kept up-to-date with the (non-test) dependencies in pom.xmlRELEASE.md- Release process documentation.gitignore- Excludes target/, deps/, IDE filessrc/main/java/org/codejive/jpm/Main.java- The main entry point of the code, but also contains JBang directives like //DEPS and //SOURCES. The //DEPS lines should be kept up-to-date with the (non-test) dependencies in pom.xml. The //SOURCES lines should contain a list of all source files (except for Main.java itself) needed to compile.
ls -la
# Key files: README.md, pom.xml, mvnw, jreleaser.yml, app.yml, src/- Default: Builds jar and CLI jar with binary distribution
-Prelease: Adds source and javadoc jars for releases- Spotless enforced in verify phase
- Java 11+ required for compilation and runtime
- Main class:
org.codejive.jpm.Main - Uses PicoCLI for command parsing, Maven Resolver for dependency resolution
- CI runs on Ubuntu with Java 21 (Temurin distribution)
- Build command:
mvn -B verify jreleaser:assemble -Prelease - Spotless formatting check is enforced - builds fail if formatting is incorrect
- Release uses JReleaser for GitHub releases and Maven Central deployment
- Always run
./mvnw spotless:applybefore committing changes - The application has no unit tests - rely on manual validation scenarios
- Search functionality may not work in all network environments, focus on core copy/install/path features
- Build times are fast (~5-35 seconds) but always set generous timeouts to avoid premature cancellation
- Use
chmod +x mvnwif you get permission denied errors on fresh clones