I'm trying to create a local cache of artifacts so I can build my Maven project offline, and it fails to create a cache artifact for an Eclipse CDT feature, so the offline build cannot succeed.
I create the local repository artifacts by running mvn -Dmaven.repo.local=/some/path/ -DgeneratePom=true clean install
, and that build succeeds.
Then I run mvn -Dmaven.repo.local=/some/path/ -o clean install
, and it fails with this error message.
ERROR] Failed to resolve target definition /opt/git/myproject/my.package.target/my.package.target.target: Failed to load p2 metadata repository from location http://download.eclipse.org/tools/cdt/releases/8.6: Repository system is offline and no local cache available for http://download.eclipse.org/tools/cdt/releases/8.6 -> [Help 1]
So then I try to create the needed artifacts by running mvn -Dmaven.repo.local=/some/path/ dependency:go-offline
. I see the following on the console, which seems to indicate that it either tries and fails to find the CDT artifacts, or thinks the artifacts are already cached.
INFO] Adding repository http://download.eclipse.org/tools/cdt/releases/8.6 [INFO] Fetching p2.index from http://download.eclipse.org/tools/cdt/releases/8.6/r/ (0B at 0B/s)
I'd like to know what this message means (i.e. does 0B indicate a failurre, or that the artifact is already present?), and how I can make the offline build work. The dependency:go-offline
build eventually fails because of a problem that is probably (?) not related to this one. Afterwards, the offline build continues to fail because it can't find the CDT artifacts.
I created this SO question and this Maven Jira Bug Report regarding the problem that happens downstream after the above message regarding 0 Bytes downloaded from the CDT update site.
The project I'm building is an Eclipse RCP app (based on Mars), and I'm using the org.eclipse.tycho:target-platform-configuration
Maven plug-in to load the dependencies from an RCP target file.
I created this tycho bug for the issue. It was closed as a duplicate of another bug. In the discussion for that bug, it appears that the problem occurs if one or more of the repositories needed to satisfy the build dependencies is a composite repository.