在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):timboudreau/tiny-maven-proxy开源软件地址(OpenSource Url):https://github.com/timboudreau/tiny-maven-proxy开源编程语言(OpenSource Language):Java 93.6%开源软件介绍(OpenSource Introduction):Tiny Maven ProxyIs exactly what it says it is - a tiny proxy server for Maven, which you can run on your local network. The only thing it does (at present) is proxy stuff Maven downloads and cache it. If you have a slow-ish internet connection, and you have multiple machines or a team that will all be building and downloading, this is the project for you. It is a tiny server you can run with By default it runs on port 5956. It has a minimal web-ui. You give it a list of repository URLs to proxy, and a folder to cache files
in, and run it. Then configure your Download a recent build here ConfigurationThere are two properties you'll want to set. You can either set them from
the command-line, or in a Example
or you could create
Other properties that affect Acteur that may be useful:
DefaultsIf The following is the list of Maven repositories it proxies by default, if you
do not set the
What This Project Is NotIt is not a full-featured Maven proxy, such as Nexus or Artifactory. Those are great if you need to manage complex mirroring setups, authentication, etc. It does no authentication, validation, checksum checking (but your Maven client will, so you'll get the same result as if you'd downloaded things directly). IndexingIDEs and other tools will try to download a Nexus-style maven index. A companion project next to this makes it simple to automate index generation. It embeds the nexus-cli tool in a single fat-jar and runs it appropriately. Since plexus depends on a version of Guice from the dawn of time, we cannot embed the indexer directly in tiny-maven-proxy. However, it is trivial to set up as a cron job. Here is an example crontab:
To build it, simply build the companion project with LoggingThe project uses bunyan-java for
logging in JSON format - more about bunyan-java here.
That makes it easy to collect metrics and stats and process log files using the
To-Dos
Under The HoodTiny Maven Proxy uses netty-http-client for downloads, and acteur for the server piece. On a request for a non-cached file, it simultaneously attempts downloads from all the servers it knows about, and when one succeeds, cancels the others. Command-line and configuration file management is done with giulius. FootprintWhile the default Java 64Mb heap is preferred, especially if the server will be heavily used, just to prove you can run this with a minimal memory footprint, you can run it and use it with an 7Mb heap - the following command-line sets up a JDK 8 vm appropriately:
A bunch of care is taken to ensure as few memory copies as possible are performed, and that downloads are read and written chunk by chunk, so the whole file is never dragged into memory at once. Hopefully this demonstrates what you can do with non-blocking I/O and a bit of care :-) |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论