{"id":19719962,"url":"https://github.com/timboudreau/tiny-maven-proxy","last_synced_at":"2025-04-29T21:30:43.349Z","repository":{"id":25705485,"uuid":"29142140","full_name":"timboudreau/tiny-maven-proxy","owner":"timboudreau","description":"A tiny maven proxy","archived":false,"fork":false,"pushed_at":"2022-10-29T21:33:54.000Z","size":161,"stargazers_count":67,"open_issues_count":5,"forks_count":16,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-05T19:23:50.995Z","etag":null,"topics":["acteur","async","java","maven","maven-proxy"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timboudreau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-12T15:35:55.000Z","updated_at":"2025-02-13T03:11:18.000Z","dependencies_parsed_at":"2023-01-14T03:14:28.958Z","dependency_job_id":null,"html_url":"https://github.com/timboudreau/tiny-maven-proxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timboudreau%2Ftiny-maven-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timboudreau%2Ftiny-maven-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timboudreau%2Ftiny-maven-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timboudreau%2Ftiny-maven-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timboudreau","download_url":"https://codeload.github.com/timboudreau/tiny-maven-proxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251585739,"owners_count":21613270,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["acteur","async","java","maven","maven-proxy"],"created_at":"2024-11-11T23:09:49.672Z","updated_at":"2025-04-29T21:30:42.896Z","avatar_url":"https://github.com/timboudreau.png","language":"Java","readme":"Tiny Maven Proxy\n================\n\nIs exactly what it says it is - a tiny proxy server for Maven, which you can\nrun on your local network.  The *only* thing it does (at present) is proxy\nstuff Maven downloads and cache it.\n\nIf you have a slow-ish internet connection, and you have multiple machines\nor a team that will all be building and downloading, this is the project for\nyou.\n\nIt is a tiny server you can run with `java -jar` somewhere on your network,\nand configure Maven to use.  It is written with [acteur](http://timboudreau.com/blog/updatedActeur/read)\nand Netty, meaning that it is asynchronous, with a small memory footprint\nand low memory usage (microscopic if you're used to Java EE - `-Xmx16M` is\nreasonable).\n\nBy default it runs on port 5956.  It has a minimal web-ui.\n\nYou give it a list of repository URLs to proxy, and a folder to cache files\nin, and run it.  Then configure your `~/.m2/settings.xml` to use it.  That's all.\n\nDownload [a recent build here](https://timboudreau.com/builds/job/tiny-maven-proxy/lastSuccessfulBuild/artifact/tiny-maven-proxy/target/tiny-maven-proxy.jar)\n\n![Screenshot](http://timboudreau.com/files/screen/d17d10e6-9e65-4314-9c68-cecb4a57023a.png)\n\n\nConfiguration\n-------------\n\nThere are two properties you'll want to set.  You can either set them from\nthe command-line, or in a `tiny-maven-proxy.properties` file that can live in\n`/etc`, `/opt/local/etc`, `/~` or `./` (these override each other in that order).\n\n\n#### Example\n\n```\njava -jar tiny-maven-proxy.jar --maven.dir /var/lib/maven --mirror https://repo1.maven.org/maven2,http://bits.netbeans.org/maven2/\n```\n\nor you could create `/etc/tiny-maven-proxy.properties` and put in it:\n\n```\nmaven.dir=/var/lib/maven\nmirror=https://repo1.maven.org/maven2,http://bits.netbeans.org/maven2/\n```\n\nOther properties that affect Acteur that may be useful:\n\n * `port` - the port to run on\n * `cors.enabled` - whether or not to answer CORS preflight requests affirmitively - on by default\n * `workerThreads` - the number of threads used to answer requests (one thread *can* work on multiple requests at a time with netty, so 4-8 is usually enough)\n * `log.file` - log to a file\n\n#### Defaults\n\nIf `maven.dir` is not set, it will create a `/maven` directory in the system\ntemporary dir (on most OSs this is wiped on reboot).\n\nThe following is the list of Maven repositories it proxies by default, if you \ndo not set the `mirror` setting:\n\n    * https://repo1.maven.org/maven2\n    * http://bits.netbeans.org/maven2/\n    * http://bits.netbeans.org/nexus/content/repositories/snapshots/\n    * https://timboudreau.com/builds/plugin/repository/everything/\n    * https://maven.java.net/content/groups/public/\n    * https://oss.sonatype.org/\n\n\nWhat This Project Is Not\n------------------------\n\nIt is not a full-featured Maven proxy, such as Nexus or Artifactory.  Those\nare great if you need to manage complex mirroring setups, authentication, etc.\n\nIt does no authentication, validation, checksum checking (but your Maven client\nwill, so you'll get the same result as if you'd downloaded things directly).\n\n\nIndexing\n--------\n\nIDEs and other tools will try to download a Nexus-style maven index.  A companion\nproject next to this makes it simple to automate index generation.  It embeds the\nnexus-cli tool in a single fat-jar and runs it appropriately.\n\nSince plexus depends on a version of Guice from the dawn of time, we cannot embed\nthe indexer directly in tiny-maven-proxy.  However, it is trivial to set up as a\ncron job.  Here is an example crontab:\n\n```\n@hourly /usr/bin/java -jar /opt/tiny-maven-proxy/tiny-maven-indexer.jar --repositoryId dr.timboudreau.org --repositoryDir /space/maven/repository\n```\n\nTo build it, simply build the companion project with `mvn install`, copy `tiny-maven-indexer.jar` to\nwherever you need it, and set it up to run periodically _as the same user tiny-maven-proxy runs as_ on the\ntarget server.\n\nLogging\n-------\n\nThe project uses [bunyan-java](https://github.com/timboudreau/bunyan-java) for\nlogging in JSON format - [more about bunyan-java here](http://timboudreau.com/blog/bunyan/read).\nThat makes it easy to collect metrics and stats and process log files using the\n`bunyan` command-line utility (to get that, install [NodeJS](http://nodejs.org)\nand then run `nbm install -g bunyan` on the command-line).\n\n\nTo-Dos\n------\n\n * Clean out `-SNAPSHOT` dependencies periodically\n\n\nUnder The Hood\n--------------\n\nTiny Maven Proxy uses [netty-http-client](https://github.com/timboudreau/netty-http-client)\nfor downloads, and [acteur](https://github.com/timboudreau/acteur) for the server piece.\nOn a request for a non-cached file, it simultaneously attempts downloads from all the\nservers it knows about, and when one succeeds, cancels the others.\n\nCommand-line and configuration file management is done [with giulius](https://github.com/timboudreau/giulius).\n\n\nFootprint\n---------\n\nWhile the default Java 64Mb heap is preferred, especially if the server will be heavily used, just to prove\nyou can run this with a minimal memory footprint, you *can* run it and use it with an 7Mb heap - the following\ncommand-line sets up a JDK 8 vm appropriately:\n\n```\njava -XX:-UseConcMarkSweepGC -Xmx7M -jar tiny-maven-proxy.jar --log.level=fatal \n\t--acteur.fork.join false --download.chunk.size 256\n```\n\nA bunch of care is taken to ensure as few memory copies as possible are performed, and that downloads are\nread and written chunk by chunk, so the whole file is never dragged into memory at once.\n\nHopefully this demonstrates what you can do with non-blocking I/O and a bit of care :-)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimboudreau%2Ftiny-maven-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimboudreau%2Ftiny-maven-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimboudreau%2Ftiny-maven-proxy/lists"}