{"id":18494927,"url":"https://github.com/qaware/go-offline-maven-plugin","last_synced_at":"2025-04-05T15:08:50.922Z","repository":{"id":57730843,"uuid":"153279483","full_name":"qaware/go-offline-maven-plugin","owner":"qaware","description":"Maven Plugin used to download all Dependencies and Plugins required in a Maven build,  so the build can be run without an internet connection afterwards.","archived":false,"fork":false,"pushed_at":"2022-11-02T14:30:50.000Z","size":59,"stargazers_count":162,"open_issues_count":5,"forks_count":15,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-29T14:11:21.053Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/qaware.png","metadata":{"files":{"readme":"Readme.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"License.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-16T12:10:51.000Z","updated_at":"2024-10-12T18:04:17.000Z","dependencies_parsed_at":"2023-01-20T21:18:58.623Z","dependency_job_id":null,"html_url":"https://github.com/qaware/go-offline-maven-plugin","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qaware%2Fgo-offline-maven-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qaware%2Fgo-offline-maven-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qaware%2Fgo-offline-maven-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qaware%2Fgo-offline-maven-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qaware","download_url":"https://codeload.github.com/qaware/go-offline-maven-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247353746,"owners_count":20925329,"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":[],"created_at":"2024-11-06T13:22:44.469Z","updated_at":"2025-04-05T15:08:50.904Z","avatar_url":"https://github.com/qaware.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Go Offline Maven Plugin\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/de.qaware.maven/go-offline-maven-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/de.qaware.maven/go-offline-maven-plugin)\n\nMaven Plugin used to download all Dependencies and Plugins required in a Maven build,\nso the build can be run without an internet connection afterwards.\n\nThis is especially relevant for modern CI-Systems like Gitlab and Circle-CI which\nneed a consistent local Maven repository in their cache to build efficiently.\n\nThe plugin can also be used to download all source files of all transitive dependencies\nof a project.\n\nMaven already has an official way to do all this: the maven-dependency-plugin go-offline goal;  \nUnfortunately, the go-offline goal suffers from several drawbacks:\n\n- Multi-Module builds are not supported since the plugin tries to download reactor-dependencies from the remote repository\n- Most parameters simply do not work\n- There is no option to download dynamic dependencies\n\nThe Go Offline Maven Plugin fixes these drawbacks.  \n\n## Requirements\n- Java 1.7 or higher\n- Maven 3.1.x or higher\n\n**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](https://issues.apache.org/jira/browse/MNG-6323) )\n\n**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\nwithout the -T option or upgrade Maven to a newer version. (See [MNG-6170](https://issues.apache.org/jira/browse/MNG-6170))  \n\n## Goals\nThe Go Offline Maven Plugin only has one goal: \"resolve-dependencies\". This goal downloads\nall external dependencies and plugins needed for your build to your local repository.\nDependencies that are built inside the reactor build of your project are excluded. For downloading,\nthe repositories specified in your pom.xml are used.\n\n## Usage\nSimply add the plugin to the pom.xml of your project. Use the root reactor pom in case of a multi module project.\nMake sure to configure any dynamic dependency your project has (see below).\n\n    \u003cplugin\u003e\n        \u003cgroupId\u003ede.qaware.maven\u003c/groupId\u003e\n        \u003cartifactId\u003ego-offline-maven-plugin\u003c/artifactId\u003e\n        \u003cversion\u003e1.2.8\u003c/version\u003e\n        \u003cconfiguration\u003e\n            \u003cdynamicDependencies\u003e\n                \u003cDynamicDependency\u003e\n                    \u003cgroupId\u003eorg.apache.maven.surefire\u003c/groupId\u003e\n                    \u003cartifactId\u003esurefire-junit4\u003c/artifactId\u003e\n                    \u003cversion\u003e2.20.1\u003c/version\u003e\n                    \u003crepositoryType\u003ePLUGIN\u003c/repositoryType\u003e\n                \u003c/DynamicDependency\u003e\n                \u003cDynamicDependency\u003e\n                    \u003cgroupId\u003ecom.querydsl\u003c/groupId\u003e\n                    \u003cartifactId\u003equerydsl-apt\u003c/artifactId\u003e\n                    \u003cversion\u003e4.2.1\u003c/version\u003e\n                    \u003cclassifier\u003ejpa\u003c/classifier\u003e\n                    \u003crepositoryType\u003eMAIN\u003c/repositoryType\u003e\n                \u003c/DynamicDependency\u003e\n                \u003cDynamicDependency\u003e\n                    \u003cgroupId\u003eorg.flywaydb\u003c/groupId\u003e\n                    \u003cartifactId\u003eflyway-commandline\u003c/artifactId\u003e\n                    \u003cversion\u003e4.0.3\u003c/version\u003e\n                    \u003ctype\u003ezip\u003c/type\u003e\n                    \u003crepositoryType\u003eMAIN\u003c/repositoryType\u003e\n                \u003c/DynamicDependency\u003e\n            \u003c/dynamicDependencies\u003e\n        \u003c/configuration\u003e\n    \u003c/plugin\u003e\n    \nTo download all dependencies to your local repository, use\n    \n    mvn de.qaware.maven:go-offline-maven-plugin:resolve-dependencies\n\nMake sure to activate any profiles etc. so that all relevant modules of your project are included\nin the Maven run.\n\n### Dynamic Dependencies\nUnfortunately some Maven Plugins dynamically load additional dependencies when they are run. Since those\ndependencies are not necessarily specified anywhere in the plugins pom.xml, the Go Offline Maven Plugin\ncannot know that it has to download those dependencies. Most prominently, the surefire-maven-plugin dynamically\nloads test-providers based on the tests it finds in the project.\n\nYou must tell the Go Offline Maven Plugin of those dynamic depenencies to ensure all dependencies are downloaded.\nFor each dependency, add a DynamicDependency block to the plugin's configuration as seen in the [Usage](#usage) section.\nEach dynamic dependency block consists of the following parameters:\n\n- *groupId* The GroupId of the dynamic dependency to download\n- *artifactId* The ArtifactId of the dynamic dependency to download\n- *version* The version of the dynamic dependency to download\n- *classifier* (optional) The classifier of the dynamic dependency to download\n- *type* (optional) The type of the dynamic dependency to download\n- *repositoryType* Either 'MAIN' or 'PLUGIN' to control from which repository the dependency is downloaded\n\nNote that Plugins are not consistent about where they pull their dynamic dependencies from. Some use the Plugin-Repository\n, some the Main-Repository. If one doesn't work, try the other.\n\n### Downloading Sources and Javadoc\nThe 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\nor a command line parameter.\n\n    \u003cplugin\u003e\n        \u003cgroupId\u003ede.qaware.maven\u003c/groupId\u003e\n        \u003cartifactId\u003ego-offline-maven-plugin\u003c/artifactId\u003e\n        \u003cversion\u003e1.2.8\u003c/version\u003e\n        \u003cconfiguration\u003e\n           \u003cdownloadSources\u003etrue\u003c/downloadSources\u003e\n           \u003cdownloadJavadoc\u003etrue\u003c/downloadJavadoc\u003e\n        \u003c/configuration\u003e\n    \u003c/plugin\u003e          \n    \nor\n\n    mvn de.qaware.maven:go-offline-maven-plugin:resolve-dependencies -DdownloadSources -DdownloadJavadoc\n    \n### Usage in CI environments\nThe Go Offline Maven Plugin can be used to build a clean repository for build server environments. The resulting repository includes exactly the dependencies and\nplugins needed for building the project.\n\n#### Gitlab\n\nFor gitlab, add the following build step to the front of your pipeline:\n\n    download-dependencies:\n      image: maven:3-jdk-8\n      stage: prepare\n      script:\n        - 'mvn de.qaware.maven:go-offline-maven-plugin:1.2.8:resolve-dependencies -Dmaven.repo.local=.m2/repository'\n      cache:\n        key: M2_REPO\n        paths:\n          - .m2/repository\n          \nThis will fill the cache \"M2_REPO\" with all needed artifacts, reusing the previous \"M2_REPO\" cache to avoid downloading all artifacts on each run.\n\nBuild steps using the repository may then be configured like this:\n\n    .build\n      image: maven:3-jdk-8\n      stage: build\n      script:\n        - 'mvn install -Dmaven.repo.local=.m2/repository'\n      cache:\n        key: M2_REPO\n        paths:\n          - .m2/repository\n        policy: pull\n\nThis will pull the previously filled cache into the build image and use it as the local maven repository.\nPolicy: pull ensures that artifacts that are generated as part of the build are not written back to the cache\n                                                                                                             .\n    \n## License\n\nApache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt) \n    \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqaware%2Fgo-offline-maven-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqaware%2Fgo-offline-maven-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqaware%2Fgo-offline-maven-plugin/lists"}