Closed frankier closed 4 years ago
Yeah, that's a known issue of Gradle that they won't fix. Please wait for the builds to finish, or use Maven: http://bytedeco.org/builds/
Thanks for your guidance. Certainly the situation is unfortunate. Oddly I went looking for an issue filed against Gradle and didn't find anything.
I'm stuck with Gradle, so this is the (platform dependent!) way I've automated the workaround (just in case anyone else stumbles upon this issue):
task fetchjavacppjars(type: Exec) {
workingDir rootDir
commandLine 'pwd'
commandLine 'sh', 'fetchjavacppjars.sh', project.property("javacppPlatform")
}
compileJava.dependsOn fetchjavacppjars
fetchjavacppjars.sh:
#!/usr/bin/env sh
tmp_dir=$(mktemp -d -t mvn-XXXXXXXXXX)
cp javacppdummy.pom $tmp_dir/pom.xml
cd $tmp_dir
mvn -Djavacpp.platform=$1 --update-snapshots compile
rm -rf $tmp_dir
javacppdummy.pom (for example)
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>i.am.a.dummy</groupId>
<artifactId>dummy</artifactId>
<version>0.0.1</version>
<dependencies>
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>openpose-platform</artifactId>
<version>1.6.0-1.5.4-SNAPSHOT</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>sonatype-nexus-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>sonatype-nexus-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</pluginRepository>
</pluginRepositories>
</project>
Thanks for your guidance. Certainly the situation is unfortunate. Oddly I went looking for an issue filed against Gradle and didn't find anything.
See https://github.com/gradle/gradle/issues/2882
I'm stuck with Gradle, so this is the (platform dependent!) way I've automated the workaround (just in case anyone else stumbles upon this issue):
Hey, this is neat! Please consider contributing something like this for the platform plugin of Gradle JavaCPP: https://github.com/bytedeco/gradle-javacpp#the-platform-plugin It shouldn't be too hard to code everything in Groovy or Java to make this more maintainable and portable.
BTW, one of the main reasons the presets have been using classifiers is because it's not possible to have more than 1 JAR per pom.xml
file without using classifiers. With Maven, that would mean maintaining 1 pom.xml
file for each platform per library, which would make the whole thing a lot hairier than it already is. On the other hand, with Gradle, we can generate easily multiple pom.xml
files from the same build.gradle
file, so we wouldn't need to use classifiers, which would also make it possible to do things like defining platform-specific dependencies. So, if you'd like to have this really fixed, I would recommend attempting to refactor the whole build system here with Gradle since this is going to happen sooner or later.
I don't have a lot of experience with Gradle, so the following may be problems with my own usage.
Gradle version
Nightly builds are not uploaded atomically
If we depend upon -- for example:
When we compile:
My interpretation, taking just one failure as an example: https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/caffe/1.0-1.5.4-SNAPSHOT/caffe-1.0-1.5.4-20200802.073134-205-linux-x86_64.jar cannot be found because the build for caffe-1.0-1.5.4-20200802.073134-205 is only partially finished
Proposed fix: Only add a build to https://oss.sonatype.org/content/repositories/snapshots/org/bytedeco/caffe/1.0-1.5.4-SNAPSHOT/maven-metadata.xml after it has finished building for all platforms so that gradle doesn't search for incomplete builds.
Old builds are deleted (attemped workaround)
I attempted to workaround this by pinning versions that have fully built like so:
This appeared to work for a while, but eventually the old builds were deleted, meaning I am only able to target the nightlies for about a week before I have to update the versions again.