{"id":30630990,"url":"https://github.com/codejive/java-jpm","last_synced_at":"2026-01-23T19:06:58.560Z","repository":{"id":247860417,"uuid":"823637952","full_name":"codejive/java-jpm","owner":"codejive","description":"A simple command line tool, taking inspiration from Node's npm, to manage Maven dependencies for Java projects that are not using build systems like Maven or Gradle.","archived":false,"fork":false,"pushed_at":"2026-01-20T21:51:03.000Z","size":168,"stargazers_count":39,"open_issues_count":17,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-21T07:17:22.404Z","etag":null,"topics":["artifacts","cli","dependencies","java","maven","packages"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codejive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-07-03T12:17:46.000Z","updated_at":"2026-01-20T21:51:06.000Z","dependencies_parsed_at":"2024-07-11T02:15:10.465Z","dependency_job_id":"16ca5573-0fec-483a-a0b5-124a35e3db59","html_url":"https://github.com/codejive/java-jpm","commit_stats":null,"previous_names":["codejive/java-jpm"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/codejive/java-jpm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codejive%2Fjava-jpm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codejive%2Fjava-jpm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codejive%2Fjava-jpm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codejive%2Fjava-jpm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codejive","download_url":"https://codeload.github.com/codejive/java-jpm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codejive%2Fjava-jpm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28698366,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T17:25:48.045Z","status":"ssl_error","status_checked_at":"2026-01-23T17:25:47.153Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["artifacts","cli","dependencies","java","maven","packages"],"created_at":"2025-08-30T21:01:22.393Z","updated_at":"2026-01-23T19:06:58.553Z","avatar_url":"https://github.com/codejive.png","language":"Java","funding_links":[],"categories":["包管理器"],"sub_categories":[],"readme":"# jpm - Java Package Manager\n\nA simple command line tool to manage Maven dependencies for Java projects that are not using build systems like Maven\nor Gradle.\n\nIt takes inspiration from Node's npm but is more focused on managing dependencies and\nis _not_ a build tool. Keep using Maven and Gradle for that. This tool is ideal for those who want to compile and\nrun Java code directly without making their lives difficult the moment they want to start using dependencies.\n\n[![asciicast](https://asciinema.org/a/ZqmYDG93jSJxQH8zaFRe7ilG0.svg)](https://asciinema.org/a/ZqmYDG93jSJxQH8zaFRe7ilG0)\n\n## Example\n\n**TL;DR**\n\n```shell\n$ jpm install com.github.lalyos:jfiglet:0.0.9\nArtifacts new: 1, updated: 0, deleted: 0\n$ java -cp deps/* HelloWorld.java\n  _   _      _ _         __        __         _     _ _\n | | | | ___| | | ___    \\ \\      / /__  _ __| | __| | |\n | |_| |/ _ \\ | |/ _ \\    \\ \\ /\\ / / _ \\| '__| |/ _` | |\n |  _  |  __/ | | (_) |    \\ V  V / (_) | |  | | (_| |_|\n |_| |_|\\___|_|_|\\___( )    \\_/\\_/ \\___/|_|  |_|\\__,_(_)\n```\n\n**Slightly longer explanation:**\n\nImagine you're writing a simple Java console command, and you want to use JFigletFont for some more\nimpactful visuals. You've written the following code:\n\n```java\nimport com.github.lalyos.jfiglet.FigletFont;\n\npublic class HelloWorld {\n    public static void main(String[] args) throws Exception {\n        System.out.println(FigletFont.convertOneLine(\"Hello, World!\"));\n    }\n}\n```\n\nBut now you get to the point that you need to add the JFigletFont library to your project. You could start\nusing Maven or Gradle, but that seems overkill for such a simple project. Instead, you can use `jpm`.\nFirst you can search for the library if you can't remember the exact name and version:\n\n```shell\n$ jpm search jfiglet\ncom.github.dtmo.jfiglet:jfiglet:1.0.1\ncom.github.lalyos:jfiglet:0.0.9\n```\n\nSo let's install the second library from that list:\n\n```shell\n$ jpm install com.github.lalyos:jfiglet:0.0.9\nArtifacts new: 1, updated: 0, deleted: 0\n```\n\nLet's see what that did:\n\n```shell\n$ tree\n.\n├── app.yml\n├── deps\n│   └── jfiglet-0.0.9.jar -\u003e /home/user/.m2/repository/com/github/lalyos/jfiglet/0.0.9/jfiglet-0.0.9.jar\n└── HelloWorld.java\n```\n\nAs you can see `jpm` has created a `deps` directory and copied the JFigletFont library there\n(_although in fact it didn't actually copy the library itself, but instead it created a symbolic link to save space_).\n\nWe can now simply run the program like this (using Java 11 or newer):\n\n```shell\n$ java -cp \"deps/*\" HelloWorld.java\n  _   _      _ _         __        __         _     _ _\n | | | | ___| | | ___    \\ \\      / /__  _ __| | __| | |\n | |_| |/ _ \\ | |/ _ \\    \\ \\ /\\ / / _ \\| '__| |/ _` | |\n |  _  |  __/ | | (_) |    \\ V  V / (_) | |  | | (_| |_|\n |_| |_|\\___|_|_|\\___( )    \\_/\\_/ \\___/|_|  |_|\\__,_(_)\n```\n\nBut if we look again at the above output of `tree`, we also see an `app.yml` file.\nThis file is used by `jpm` to keep track of the dependencies of your project. If you want to share your project\nwith someone else, you can simply share the `app.yml` file along with the code, and they can run `jpm install`\nto get the required dependencies to run the code.\n\n_NB: We could have used `jpm copy` instead of `jpm install` to copy the dependencies but that would not have created\nthe `app.yml` file._\n\n## Actions\n\nThe `app.yml` file doesn't just track dependencies - it can also define custom actions that can be executed with the `jpm do` command or through convenient alias commands.\n\n### Defining Actions\n\nActions are defined in the `actions` section of your `app.yml` file:\n\n```yaml\ndependencies:\n  com.github.lalyos:jfiglet:0.0.9\n\nactions:\n  setup: \"echo Do some actual work here...\"\n  build: \"javac -cp {{deps}} *.java\"\n  run: \"java -cp {{deps}} HelloWorld\"\n  test: \"java -cp {{deps}} TestRunner\"\n  it: \"java -cp {{deps}} IntegrationTestRunner\"\n  clean: \"rm -f *.class\"\n```\n\n### Executing Actions\n\nYou can execute actions using the `jpm do` command:\n\n```shell\n$ jpm do --list                 # Lists all available actions\n$ jpm do build                  # Runs the build action\n$ jpm do run --arg foo -a bar   # Passes \"foo\" and \"bar\" to the run action\n$ jpm do build -a --verbose run -a fubar   # Passes \"--verbose\" to build and \"fubar\" to run\n```\n\nOr use the convenient alias commands that exist especially for \"clean\", \"build\", \"test\" and \"run\":\n\n```shell\n$ jpm build        # Executes the 'build' action\n$ jpm run          # Executes the 'run' action\n$ jpm test         # Executes the 'test' action\n$ jpm clean        # Executes the 'clean' action\n```\n\nAlias commands can accept additional arguments that will be passed through to the underlying action:\n\n```shell\n$ jpm run --verbose debug    # Passes '--verbose debug' to the run action\n```\n\n### Variable Substitution\n\nActions support several variable substitution features for cross-platform compatibility:\n\n- **`{{deps}}`** - Replaced with the full classpath of all dependencies\n- **`{/}`** - Replaced with the file separator (`\\` on Windows, `/` on Linux/Mac)\n- **`{:}`** - Replaced with the path separator (`;` on Windows, `:` on Linux/Mac)\n- **`{~}`** - Replaced with the user's home directory (The actual path on Windows, `~` on Linux/Mac)\n- **`{./path/to/file}`** - Converts relative paths to platform-specific format\n- **`{./libs:./ext:~/usrlibs}`** - Converts entire class paths to platform-specific format\n- **`{;}`** - For use with multi-command actions (`\u0026` on Windows, `;` on Linux/Mac). Really not _that_ useful, you can use `\u0026\u0026` instead which works on all platforms\n\nExample with cross-platform compatibility:\n\n```yaml\nactions:\n  build: \"javac -cp {{deps}} -d {./target/classes} src{/}*.java\"\n  run: \"java -cp {{deps}}{:}{./target/classes} Main\"\n  test: \"java -cp {{deps}}{:}{./target/classes} org.junit.runner.JUnitCore TestSuite\"\n```\n\nNB: The `{{deps}}` variable substitution is only performed when needed - if your action doesn't contain `{{deps}}`, jpm won't resolve the classpath, making execution faster for simple actions that don't require dependencies.\n\nNB2: These actions are just a very simple convenience feature. For a much more full-featured cross-platform action runner I recommend taking a look at:\n\n - [Just](https://github.com/casey/just) - Just a command runner\n\n## Installation\n\nFor now the simplest way to install `jpm` is to use [JBang](https://www.jbang.dev/download/):\n\n```shell\njbang app install jpm@codejive\n```\n\nBut you can also simply download and unzip the [release package](https://github.com/codejive/java-jpm/releases/latest) and run the `bin/jpm` script.\n\n## Usage\n\nSee:\n\n```\nUsage: jpm [-hV] [COMMAND]\nSimple command line tool for managing Maven artifacts\n  -h, --help      Show this help message and exit.\n  -V, --version   Print version information and exit.\nCommands:\n  copy, c     Resolves one or more artifacts and copies them and all their\n                dependencies to a target directory. By default jpm will try to\n                create symbolic links to conserve space.\n\n              Example:\n                jpm copy org.apache.httpcomponents:httpclient:4.5.14\n\n  search, s   Without arguments this command will start an interactive search\n                asking the user to provide details of the artifact to look for\n                and the actions to take. When provided with an argument this\n                command finds and returns the names of those artifacts that\n                match the given (partial) name.\n\n              Example:\n                jpm search httpclient\n\n  install, i  This adds the given artifacts to the list of dependencies\n                available in the app.yml file. It then behaves just like 'copy\n                --sync' and copies all artifacts in that list and all their\n                dependencies to the target directory while at the same time\n                removing any artifacts that are no longer needed (ie the ones\n                that are not mentioned in the app.yml file). If no artifacts\n                are passed the app.yml file will be left untouched and only the\n                existing dependencies in the file will be copied.\n\n              Example:\n                jpm install org.apache.httpcomponents:httpclient:4.5.14\n\n  path, p     Resolves one or more artifacts and prints the full classpath to\n                standard output. If no artifacts are passed the classpath for\n                the dependencies defined in the app.yml file will be printed\n                instead.\n\n              Example:\n                jpm path org.apache.httpcomponents:httpclient:4.5.14\n\n  exec        Executes a shell command that can use special tokens to deal with\n                OS-specific quirks like paths. This means that commands can be\n                written in a somewhat platform independent way and will work on\n                Windows, Linux and MacOS.\n\n              Supported tokens and what they expand to:\n                {{deps}}  : the classpath of all dependencies defined in the app.yml file\n                {/} : the OS' file path separator\n                {:} : the OS' class path separator\n                {~} : the user's home directory using the OS' class path format\n                {;} : the OS' command separator\n                {./file/path} : a path using the OS' path format (must start with './'!)\n                {./lib:./ext} : a class path using the OS' class path format (must start with './'!)\n                @[ ... ] : writes contents to a file and inserts @\u003cpath-to-file\u003e instead\n\n              In actuality the command is pretty smart and will try to do the\n                right thing, as long as {{deps}} is the only token you use. In\n                the examples below the first line shows how to do it the hard\n                way, by specifying everything manually, while the second line\n                shows how much easier it is when you can rely on the built-in\n                smart feature. Is the smart feature bothering you? Just use any\n                of the other tokens besides {{deps}} and it will be turned off.\n                By default args files will only be considered for Java commands\n                that are know to support them (java, javac, javadoc, etc), but\n                you can indicate that your command supports it as well by\n                adding a single @ as the first character of the command.\n\n              Example:\n                jpm exec javac -cp @[{{deps}}] -d {./out/classes} --source-path {./src/main/java} App.java\n                jpm exec javac -cp {{deps}} -d out/classes --source-path src/main/java App.java\n                jpm exec @kotlinc -cp {{deps}} -d out/classes src/main/kotlin/App.kt\n\n  do          Executes an action command defined in the app.yml file. The\n                command is executed using the same rules as the exec command,\n                so it can use all the same tokens and features. You can also\n                pass additional arguments to the action using -a or --arg\n                followed by the argument value. You can chain multiple actions\n                and their arguments in a single command line.\n              Example:\n                jpm do build\n                jpm do test --arg verbose\n                jpm do build -a --fresh test -a verbose\n\n  clean       Executes the 'clean' action as defined in the app.yml file.\n  build       Executes the 'build' action as defined in the app.yml file.\n  run         Executes the 'run' action as defined in the app.yml file.\n  test        Executes the 'test' action as defined in the app.yml file.\n```\n\n## Development\n\nTo build the project simply run:\n\n```shell\n./mvnw spotless:apply clean install\n```\n\nOf course, once you've got `jpm` installed you can do:\n\n```shell\njpm do clean build\njpm test\njpm run\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodejive%2Fjava-jpm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodejive%2Fjava-jpm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodejive%2Fjava-jpm/lists"}