mbaeuerle / Briss-2.0

Briss 2.0 is intended to be a GUI Update for the Briss PDF cropping tool.
GNU General Public License v3.0
499 stars 48 forks source link

./gradlew distZip not working properly #36

Closed stefanoconiglio closed 2 years ago

stefanoconiglio commented 2 years ago

Here's a trace of the error:

./gradlew distZip
> Task :compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
   > Could not download jai_core-1.1.3.jar (javax.media:jai_core:1.1.3)
      > Could not get resource 'http://maven.geotoolkit.org/javax/media/jai_core/1.1.3/jai_core-1.1.3.jar'.
         > Tag mismatch!

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.3/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 14s
1 actionable task: 1 executed

Should I use a version of Gradle < 7.0?

cleydyr commented 2 years ago

Hey, @stefanoconiglio .

I couldn't reproduce the issue using the Gradle wrapper included with the repo. It looks like a temporary issue. When I perform a request to the resource URL (http://maven.geotoolkit.org/javax/media/jai_core/1.1.3/jai_core-1.1.3.jar), the server responds with a 301 HTTP code redirecting to https://nexus.geomatys.com/repository/geotoolkit/javax/media/jai_core/1.1.3/jai_core-1.1.3.jar.

Can you try running ./gradlew distZip again?

mbaeuerle commented 2 years ago

I also couldn't reproduce the issue using JDK 11 and the provided gradlew. It then will use gradle 6.3 as defined in the gradle/wrapper/gradle-wrapper.properties. Using gradle 7 however doesn't seem to work yet and needs some adaptation, but at least in my case it doesn't seem to fail with the same error you provided.

cleydyr commented 2 years ago

In Gradle 7.x compile configurations were removed. Also, the build.gradle repositories will cause the build to fail due to the use of insecure http URLs. Here's a build.gradle that worked for me:


plugins {
    id 'org.openjfx.javafxplugin' version '0.0.8'
    id 'java'
    id 'application'
}

mainClassName = 'at.laborg.briss.Briss'
applicationDefaultJvmArgs = ["-Xms128m", "-Xmx1024m"]
def javaFxVersion = '11'

repositories {
    maven { url "https://clojars.org/repo" } // For jpedal
    maven { url "https://maven.geotoolkit.org/" } // For jpedal transitive dependencies
    mavenCentral()
}

dependencies {
    implementation 'com.itextpdf:itextpdf:5.5.10'
    implementation 'org.jpedal:jpedal-lgpl:4.74b27'

    runtimeOnly "org.openjfx:javafx-controls:$javaFxVersion:win"
    runtimeOnly "org.openjfx:javafx-controls:$javaFxVersion:linux"
    runtimeOnly "org.openjfx:javafx-controls:$javaFxVersion:mac"
    runtimeOnly "org.openjfx:javafx-base:$javaFxVersion:win"
    runtimeOnly "org.openjfx:javafx-base:$javaFxVersion:linux"
    runtimeOnly "org.openjfx:javafx-base:$javaFxVersion:mac"
    runtimeOnly "org.openjfx:javafx-swing:$javaFxVersion:win"
    runtimeOnly "org.openjfx:javafx-swing:$javaFxVersion:linux"
    runtimeOnly "org.openjfx:javafx-swing:$javaFxVersion:mac"
}

javafx {
    version = javaFxVersion
    modules = [ 'javafx.controls', 'javafx.base', 'javafx.swing' ]
}
------------------------------------------------------------
Gradle 7.4
------------------------------------------------------------

Build time:   2022-02-08 09:58:38 UTC
Revision:     f0d9291c04b90b59445041eaa75b2ee744162586

Kotlin:       1.5.31
Groovy:       3.0.9
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          11.0.14 (Azul Systems, Inc. 11.0.14+9-LTS)
OS:           Mac OS X 12.2.1 aarch64
mbaeuerle commented 2 years ago

@stefanoconiglio gradle was now updated to version 7.4. I will close this issue for now, let us know if you still experience issues.