在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):qaware/go-offline-maven-plugin开源软件地址(OpenSource Url):https://github.com/qaware/go-offline-maven-plugin开源编程语言(OpenSource Language):Java 100.0%开源软件介绍(OpenSource Introduction):Go Offline Maven PluginMaven Plugin used to download all Dependencies and Plugins required in a Maven build, so the build can be run without an internet connection afterwards. This is especially relevant for modern CI-Systems like Gitlab and Circle-CI which need a consistent local Maven repository in their cache to build efficiently. The plugin can also be used to download all source files of all transitive dependencies of a project. Maven already has an official way to do all this: the maven-dependency-plugin go-offline goal;
The Go Offline Maven Plugin fixes these drawbacks. Requirements
Warning: Maven 3.5.2 has a Bug that causes the Plugin to hang. If you experience hangups during downloading dependencies, please upgrade to Maven 3.5.3 or higher (See MNG-6323 ) Warning: Maven versions 3.2.x and 3.3.x have a bug that can cause the plugin to fail if maven is started in parallel build mode (-T option). Please call the go-offline-maven-plugin without the -T option or upgrade Maven to a newer version. (See MNG-6170) GoalsThe Go Offline Maven Plugin only has one goal: "resolve-dependencies". This goal downloads all external dependencies and plugins needed for your build to your local repository. Dependencies that are built inside the reactor build of your project are excluded. For downloading, the repositories specified in your pom.xml are used. UsageSimply add the plugin to the pom.xml of your project. Use the root reactor pom in case of a multi module project. Make sure to configure any dynamic dependency your project has (see below).
To download all dependencies to your local repository, use
Make sure to activate any profiles etc. so that all relevant modules of your project are included in the Maven run. Dynamic DependenciesUnfortunately some Maven Plugins dynamically load additional dependencies when they are run. Since those dependencies are not necessarily specified anywhere in the plugins pom.xml, the Go Offline Maven Plugin cannot know that it has to download those dependencies. Most prominently, the surefire-maven-plugin dynamically loads test-providers based on the tests it finds in the project. You must tell the Go Offline Maven Plugin of those dynamic depenencies to ensure all dependencies are downloaded. For each dependency, add a DynamicDependency block to the plugin's configuration as seen in the Usage section. Each dynamic dependency block consists of the following parameters:
Note that Plugins are not consistent about where they pull their dynamic dependencies from. Some use the Plugin-Repository , some the Main-Repository. If one doesn't work, try the other. Downloading Sources and JavadocThe plugin can also download the source files and/or javadoc of the project's transitive dependencies. This behaviour can either be activated via the pom.xml or a command line parameter.
or
Usage in CI environmentsThe Go Offline Maven Plugin can be used to build a clean repository for build server environments. The resulting repository includes exactly the dependencies and plugins needed for building the project. GitlabFor gitlab, add the following build step to the front of your pipeline:
This will fill the cache "M2_REPO" with all needed artifacts, reusing the previous "M2_REPO" cache to avoid downloading all artifacts on each run. Build steps using the repository may then be configured like this:
This will pull the previously filled cache into the build image and use it as the local maven repository. Policy: pull ensures that artifacts that are generated as part of the build are not written back to the cache . LicenseApache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt) |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论