Code Monkey home page Code Monkey logo

Comments (6)

reckbo avatar reckbo commented on June 15, 2024 1

It works, you are my hero.

To help anyone else using gradle I've listed the relevant lines in my build.gradle below.


buildscript {
    repositories {
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }
    dependencies {
        classpath "io.spring.gradle:dependency-management-plugin:0.5.4.RELEASE"
    }
}
apply plugin: "io.spring.dependency-management"

repositories {
    jcenter()
    maven {
          url "http://maven.imagej.net/content/groups/public/"
    }
}
dependencyManagement {
    imports {
        mavenBom 'net.imagej:pom-imagej:14.1.0'
    }
}

dependencies {
    compile 'net.imagej:imagej'
}

from tutorials.

hinerm avatar hinerm commented on June 15, 2024

'net.imagej:imagej:2.0.0-rc-9-SNAPSHOT'

First off, depending on a SNAPSHOT is not advised because you are not guaranteed to get consistent behavior back.

In this case, rc-9 is also extremely old and probably filled with problems. You can find the latest release version on GitHub and maven.

But in general, the safest thing to do is to inherit dependency management from a release version of the bill of materials we provide, typically by using it as a parent pom or scope:importing it, so that you don't need to specify any other component versions manually. Off-hand I'm not sure how this works in gradle.

which seemed to download every ImageJ package known to man

ImageJ 1.x was designed as a single java project. ImageJ2 is highly modular and extensible. net.imagej:imagej is simply the aggregator for all these components, bundling them together to make a cohesive distribution.

If you have further questions about any of this let me know. Also for general development questions/discussions you may be interested in the ImageJ forum.. I think the community would benefit from the perspective and experiences of a developer who uses gradle.

from tutorials.

ctrueden avatar ctrueden commented on June 15, 2024

In addition to @hinerm's comments, a couple other notes:

java.io.IOException: invalid constant type: 18 at 1

This means you are using a too-old version of Javassist (one of the project's dependencies) with Java 8. This is probably because you are using an old version of net.imagej:imagej. The problem was fixed a few months ago by upgrading to a newer Javassistโ€”try using the latest version of ImageJ.

java.util.zip.ZipException: error in opening zip file

This often means your build system had problems downloading a JAR file. Easiest solution is to delete the relevant folder from your Gradle/Maven cache, and build again to redownload. However, in this case, the error is about a POM file, which should not be getting treated as a ZIP in the first place. So that is odd. But it may also be a red herring, unrelated to your specific woes here.

from tutorials.

reckbo avatar reckbo commented on June 15, 2024

Thanks for your help guys -- unfortunately upgrading to the latest release version ('net.imagej:imagej:2.0.0-rc-43') didn't help, although it did vanquish the zip file error.

I took @hinerm's suggestion and added the imagej bom to my gradle build, using version 3.1:

mavenBom 'net.imagej:bom-imagej:3.1'

The problem now is that it fails to find some dependencies (you can see the error below). I've tried these three different maven urls (in addition to maven central):

 url "http://maven.imagej.net/content/groups/hosted/"
 url "http://maven.imagej.net/content/groups/public/"
 url "http://maven.imagej.net/content/repositories/thirdparty/"

The first one worked when I was not using the bom and just importing imagej-20.0.0-rc-43. Should
I be using a different url?

I should mention that my end goal is to use the dilation, erosion, and 3d distance transform
ops in my application, but I probably still need to include the whole imagej framework right?

Thanks for any help!
Ryan


FAILURE: Build failed with an exception.

from tutorials.

hinerm avatar hinerm commented on June 15, 2024

mavenBom 'net.imagej:bom-imagej:3.1'

Whooops... mis-communication here ๐Ÿ˜„ the pom-imagej project _is_ the bill of materials.

bom-imagej is an unfortunate historical artifact from when we were experimenting with different pom/bom configurations.

if you use:

mavenBom 'net.imagej:pom-imagej:14.1.0'

and remove any other ImageJ version specification, does it work better?

from tutorials.

hinerm avatar hinerm commented on June 15, 2024

To help anyone else using gradle I've listed the relevant lines in my build.gradle below.

Awesome! It's great to hear that it worked for you. Thanks for your persistence ๐Ÿ˜„

We try to collect all our documentation on the ImageJ wiki - so I started a gradle page in case you run into further pitfalls.

from tutorials.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.