Comments (6)
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.
'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:import
ing 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.
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.
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.
- What went wrong:
Could not resolve all dependencies for configuration ':compile'.Could not resolve net.imagej:imagej-ops:0.6.0.
Required by:
:heartfibers-new:unspecified > net.imagej:imagej:2.0.0-rc-16
Could not resolve net.imagej:imagej-ops:0.6.0.
Could not parse POM http://maven.imagej.net/content/groups/hosted/net/imagej/imagej-ops/0.6.0/imagej-ops-0.6.0.pom
> Could not find net.imagej:pom-imagej:3.2.
Could not resolve net.imagej:imagej-plugins-commands:0.3.0.
Required by:
:heartfibers-new:unspecified > net.imagej:imagej:2.0.0-rc-16
Could not resolve net.imagej:imagej-plugins-commands:0.3.0.
Could not parse POM http://maven.imagej.net/content/groups/hosted/net/imagej/imagej-plugins-commands/0.3.0/imagej-plugins-commands-0.3.0.pom
> Could not find net.imagej:pom-imagej:3.2.
Could not resolve net.imagej:imagej-ui-swing:0.8.0.
Required by:
:heartfibers-new:unspecified > net.imagej:imagej:2.0.0-rc-16
Could not resolve net.imagej:imagej-ui-swing:0.8.0.
Could not parse POM http://maven.imagej.net/content/groups/hosted/net/imagej/imagej-ui-swing/0.8.0/imagej-ui-swing-0.8.0.pom
> Could not find net.imagej:pom-imagej:3.2.
Could not resolve net.imagej:imagej-ui-swing:0.8.0.
Required by:
:heartfibers-new:unspecified > net.imagej:imagej:2.0.0-rc-16 > net.imagej:imagej-legacy:0.8.5
Could not resolve net.imagej:imagej-ui-swing:0.8.0.
Could not parse POM http://maven.imagej.net/content/groups/hosted/net/imagej/imagej-ui-swing/0.8.0/imagej-ui-swing-0.8.0.pom
> Could not find net.imagej:pom-imagej:3.2.
from tutorials.
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.
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)
- Fix ExecuteCommands to work with fake format changes HOT 7
- some error massage
- Invalid service: net.imagej.legacy.LegacyService HOT 1
- Python kernel error (in Binder): PYJNIUS_JAR environment variable not defined. HOT 10
- Link to more awesome data science tutorials HOT 1
- Create tutorial about imglib2-roi and how to work with labelings HOT 2
- Useful Writing Plugin Setup Video HOT 2
- DynamicCommand: combobox in the example never gets updated HOT 2
- Include Maven installation of ImageJ and Fiji artifacts in postBuild for binder HOT 6
- Problems with %classpath HOT 3
- Consider using Jupytext for version control of Jupyter notebooks HOT 1
- A connection to the notebook server could not be established.
- "ImageJ with Python Kernel" section 6.2 doesn't work HOT 2
- HowTo wishlist HOT 15
- Move working-with-modules to howtos
- Address dependency skew in BeakerX notebooks
- Resolve BeakerX component version skew (kotlin, okio, maybe more)
- Tab completion isn't working in the Jupyter Notebooks
- Add -Djava.net.useSystemProxies=true tip to sections about proxy configuration
- Update to the latest version of ImageJ2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tutorials.