For (1) you should look for versions like 1.2.3-SNAPSHOT or 1.2.+ on your declared dependencies (or at ./gradlew dependencies for simplicity). If you have any such versions, do you really need them? Using fixed versions like 1.2.3 should be faster.
The question is kind of insufficient to tell, because no build.gradle had been provided. But I'd assume, that the reason is any -SNAPSHOT dependency, which is not being cached. Building against a local copy of that dependency should result in not downloading the maven-metadata.xml over and over again; or use mavenLocal(). Building against a stable version should also result in caching.
The cause of slow downloads for maven-metadata.xml files is that one of your proxy repositories has a very slow remote.
This problem will be compounded if either of the "metadata max age" and "not found cache ttl" settings is set too low. Thus it will check the circle too fast and download it everytime from scratch. Turn it up to 12 hours. Default should be 30min (1800sec) what is a too short period of time.
I've written a Gradle plugin in groovy and used Gradle to build it. I've got a local network Artifactory server that I publish the results to using the Gradle Artifactory plugin and the maven-publish plugin in Gradle. I have another Gradle build script that relies on this plugin as a dependency. I've been able to get this all working if I list my dependency with a specific version. I've tried to use a maven version range (ex. '[1.0,2.0)'), but this fails saying it can't find maven-metadata.xml. I checked Artifactory, and sure enough, it isn't there. What do I need to do to produce it, preferably during the build of the plugin?
I've searched the Gradle, Artifactory, and Maven documentation to understand maven-metadata.xml and how to generate and deploy. It makes sense what it is, and I could probably build one manually, but I can't find anything that explains specifically how to automatically generate it in Gradle with either the maven-publish plugin or the artifactory-gradle-plugin. I don't want to have to manually update the file since that would defeat the automation effort, and I don't want to switch to mvn since I've already invested so much in Gradle.
I had the same problem and it turned out that the Artifactory repository was not a Maven repo, it was a Generic repo. It took me forever to notice because I didn't create the repo and I assumed it was a Maven repo, and deploying/resolving otherwise was working as expected.
After switching to a Maven repo, the maven-metadata.xml's were generated upon publishing.
I find the least amount of stuff I custom-set, the better. and prefer to piggy back on the defaults...which means setting the values which drive the defaults... in the build.gradle .. and not to set the myCustomPublicationName(MavenPublication)
This reply was created from a merged topic originally titled Creating a WebJar - gradle upload does not create maven-metadata.xml. I am creating a webjar with gradle. Everything works fine except gradle uploadWebjar does not create the necessary maven-metadata.xml
Here is my build.gradle:
-----------------------------------
I have been running through several problems lately since I bought a new computer. I was working on a mod for a game called Grand Chase on my old computer. Everything was working perfectly until I bought this computer. At first, the error I had was "Open Project has encountered a problem" every time I tried to open the Minecraft folder inside the eclipse. ( -and-modding-java-edition/minecraft-mods/modification-development/2982622-open-project-has-encountered-a-problem-minecraft). Now as I was trying again to work on my mod, I ran through another error which I have no clue on how to fix it. After I downloaded eclipse, added the environment variables and downloaded the forge for 1.7.10, I tried to run the gradlew commands on the command prompt but it says the following:
* What went wrong:
A problem occurred configuring root project 'GrandChaseMod'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve org.eclipse.equinox:common:[3.2.0,4.0.0).
Required by:
:GrandChaseMod:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT > org.eclipse.core:jobs:3.5.300-v20130429-1813
:GrandChaseMod:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT > org.eclipse.core:contenttype:3.4.200-v20130326-1255
:GrandChaseMod:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT > org.eclipse.equinox:preferences:3.5.100-v20130422-1538
> Failed to list versions for org.eclipse.equinox:common.
> Unable to load Maven meta-data from -metadata.xml.
> Could not GET ' -metadata.xml'. Received status code 501 from server: HTTPS Required
> Could not resolve org.eclipse.equinox:preferences:[3.2.0,4.0.0).
Required by:
:GrandChaseMod:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT > org.eclipse.core:contenttype:3.4.200-v20130326-1255
> Failed to list versions for org.eclipse.equinox:preferences.
> Unable to load Maven meta-data from -metadata.xml.
> Could not GET ' -metadata.xml'. Received status code 501 from server: HTTPS Required
> Could not resolve org.eclipse.equinox:registry:[3.2.0,4.0.0).
Required by:
:GrandChaseMod:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT > org.eclipse.core:contenttype:3.4.200-v20130326-1255
> Failed to list versions for org.eclipse.equinox:registry.
> Unable to load Maven meta-data from -metadata.xml.
> Could not GET ' -metadata.xml'. Received status code 501 from server: HTTPS Required
> Could not resolve org.eclipse.core.runtime:compatibility:[3.1.0,4.0.0).
Required by:
:GrandChaseMod:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT > org.eclipse.core:resources:3.2.1-R32x_v20060914
> Failed to list versions for org.eclipse.core.runtime:compatibility.
> Unable to load Maven meta-data from -metadata.xml.
> Could not GET ' -metadata.xml'. Received status code 501 from server: HTTPS Required
> Could not resolve org.eclipse.core:expressions:[3.1.0,4.0.0).
Required by:
:GrandChaseMod:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT > org.eclipse.core:resources:3.2.1-R32x_v20060914
> Failed to list versions for org.eclipse.core:expressions.
> Unable to load Maven meta-data from -metadata.xml.
> Could not GET ' -metadata.xml'. Received status code 501 from server: HTTPS Required
> Could not resolve org.eclipse.core:filesystem:[1.0.0,2.0.0).
Required by:
:GrandChaseMod:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT > org.eclipse.core:resources:3.2.1-R32x_v20060914
> Failed to list versions for org.eclipse.core:filesystem.
> Unable to load Maven meta-data from -metadata.xml.
> Could not GET ' -metadata.xml'. Received status code 501 from server: HTTPS Required
> Could not resolve org.eclipse:osgi:[3.7.0,4.0.0).
Required by:
:GrandChaseMod:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT > org.eclipse.core:runtime:3.9.0-v20130326-1255
> Failed to list versions for org.eclipse:osgi.
> Unable to load Maven meta-data from -metadata.xml.
> Could not GET ' -metadata.xml'. Received status code 501 from server: HTTPS Required
> Could not resolve org.eclipse.equinox:common:[3.6.100,4.0.0).
Required by:
:GrandChaseMod:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT > org.eclipse.core:runtime:3.9.0-v20130326-1255
> Failed to list versions for org.eclipse.equinox:common.
> Unable to load Maven meta-data from -metadata.xml.
> Could not GET ' -metadata.xml'. Received status code 501 from server: HTTPS Required
> Could not resolve org.eclipse.core:jobs:[3.2.0,4.0.0).
Required by:
:GrandChaseMod:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT > org.eclipse.core:runtime:3.9.0-v20130326-1255
> Failed to list versions for org.eclipse.core:jobs.
> Unable to load Maven meta-data from -metadata.xml.
> Could not GET ' -metadata.xml'. Received status code 501 from server: HTTPS Required
> Could not resolve org.eclipse.equinox:registry:[3.4.0,4.0.0).
Required by:
:GrandChaseMod:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT > org.eclipse.core:runtime:3.9.0-v20130326-1255
> Failed to list versions for org.eclipse.equinox:registry.
> Unable to load Maven meta-data from -metadata.xml.
> Could not GET ' -metadata.xml'. Received status code 501 from server: HTTPS Required
> Could not resolve org.eclipse.equinox:preferences:[3.4.0,4.0.0).
Required by:
:GrandChaseMod:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT > org.eclipse.core:runtime:3.9.0-v20130326-1255
> Failed to list versions for org.eclipse.equinox:preferences.
> Unable to load Maven meta-data from -metadata.xml.
> Could not GET ' -metadata.xml'. Received status code 501 from server: HTTPS Required
> Could not resolve org.eclipse.core:contenttype:[3.3.0,4.0.0).
Required by:
:GrandChaseMod:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT > org.eclipse.core:runtime:3.9.0-v20130326-1255
> Failed to list versions for org.eclipse.core:contenttype.
> Unable to load Maven meta-data from -metadata.xml.
> Could not GET ' -metadata.xml'. Received status code 501 from server: HTTPS Required
> Could not resolve org.eclipse.equinox:app:[1.0.0,2.0.0).
Required by:
:GrandChaseMod:unspecified > net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT > net.minecraftforge.srg2source:Srg2Source:3.2-SNAPSHOT > org.eclipse.core:runtime:3.9.0-v20130326-1255
> Failed to list versions for org.eclipse.equinox:app.
> Unable to load Maven meta-data from -metadata.xml.
> Could not GET ' -metadata.xml'. Received status code 501 from server: HTTPS Required