gitblit-org / gitblit

pure java git solution
http://gitblit.com
Apache License 2.0
2.28k stars 670 forks source link

Gitblit Setup on failing due to error "Failed to fetch [eclipse-snapshots] prefix index" #1337

Closed ghost closed 4 years ago

ghost commented 4 years ago

Getting an exception while building WAR file using ANT, this is the console output

$ ant buildWAR
Buildfile: C:\Projects\build.xml
      [get] Destination already exists (skipping): C:\Users\U6049694\.moxie\moxie-toolkit-0.9.4.jar

prepare:
  [mx:init] =========================================================
  [mx:init] Gitblit  (1.9.1)
  [mx:init] ---------------------------------------------------------
  [mx:init] project metadata
  [mx:init]            name: Gitblit
  [mx:init]     description: pure Java Git solution
  [mx:init]         groupId: com.gitblit
  [mx:init]      artifactId: gitblit
  [mx:init]         version: 1.9.1
  [mx:init]             url: http://gitblit.com

BUILD FAILED
C:\Projects\eiddo\gitblit\build.xml:48: org.moxie.MoxieException: java.lang.RuntimeException: Error!

Failed to fetch [eclipse-snapshots] prefix index
Do you need to run offline?
  append "-Dmx.online=false" to your Ant launch arguments
Do you need to specify a proxy in C:\Users\U6049694\.moxie\settings.moxie?
  see http://gitblit.github.io/moxie/settings.html
        at org.moxie.ant.MxInit.execute(MxInit.java:220)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
        at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
        at org.apache.tools.ant.Task.perform(Task.java:350)
        at org.apache.tools.ant.Target.execute(Target.java:449)
        at org.apache.tools.ant.Target.performTasks(Target.java:470)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1391)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1254)
        at org.apache.tools.ant.Main.runBuild(Main.java:830)
        at org.apache.tools.ant.Main.startAnt(Main.java:223)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)
Caused by: java.lang.RuntimeException: Error!
flaix commented 4 years ago

Hm, you are building 1.9.1, so the HTTPS problem should be fixed. To make sure, can you check in build.moxie what the URL for the eclipse-snapshots registered repository is? Can you reach it from a browser?

ghost commented 4 years ago

@fzs The eclipse-snapshots url is https://repo.eclipse.org/content/groups/snapshots And I can access it from the browser

ghost commented 4 years ago

@fzs I'm able to consistently reproduce this issue on different windows machines as well.

flaix commented 4 years ago

I'll have to try and reproduce it on a Windows machine. Usually this means that some URL is not reachable or the response is not understood.

Might be a forward. Can you change the URL to end in a / and try again? https://repo.eclipse.org/content/groups/snapshots/

ghost commented 4 years ago

@fzs I tried what you suggested with no luck, It's still the same

flaix commented 4 years ago

Which JDK is this?

ghost commented 4 years ago

It is 1.8.0_111

flaix commented 4 years ago

I am sorry but I cannot reproduce this. I tried it on Windows 10 with JDK 1.8.0_232 and Ant 1.9.14. It always pulled all the dependencies and I was also able to build the WAR.

It does only pull from Maven central and just one item from Github (Gitblit-maven). So the fact that it tries to pull from Eclipse in your case might point to a problem pulling from Maven Central, actually.

Then again, it stops at pulling the index already.

Have you been building Gitblit before successfully and only now it fails? In that case you may need to delete the cached index files in the local .moxie repository. Find the .moxie directory in your home directory, go into remote and delete the repo.eclipse.org_* directories. Then build again.

You can also try and delete the two eclipse repository entries from the build.moxie file and build again. I did that and it does still build successfully. It may only complain a bit about missing SHA files when downloading a dependency.

ghost commented 4 years ago

@fzs Thanks for your help so far! I tried to do what you said but the repo.eclipse.org_* directories are not being created at all. could this be some sort of proxy issue from India?

flaix commented 4 years ago

So were you already able to compile Gitblit before or is this your first try?

Since you do not have index directories for Eclipse, it sounds like you haven’t compiled it yet. In that case delete your .moxie directory. Then edit the build.moxie file and remove the two eclipse lines from the repository section.

ghost commented 4 years ago

@fzs This is the first time that I'm building Gitblit. I tried to delete the entire .moxie directory and then commenting out the two lines in build.moxie. The build is passing and I'm able to generate a war!