I am planning to use ImageJ for a webapp but it seems ImageJ maven dependencies are not in the central maven repository.
Am I right?
Is this going to change when ImageJ 2.x is released?
EDIT: Updated on July 4, 2014 to reflect the latest status.
The builds on Maven Central with groupId gov.nih.imagej were done by a third party, but the official ImageJ 1.x builds are available from Maven Central with groupId net.imagej and artifactId ij starting from version 1.48r; e.g.:
<dependency>
<groupId>net.imagej</groupId>
<artifactId>ij</artifactId>
<version>1.48r</version>
</dependency>
Older official builds of ImageJ 1.x are available from the ImageJ Maven repository. It also has ImageJ2 builds which consist of several artifacts all prefixed by imagej-. You can use it via the following configuration:
<repositories>
<repository>
<id>imagej.public</id>
<url>http://maven.imagej.net/content/groups/public</url>
</repository>
</repositories>
It is suggested to model your POM after the ImageJ Tutorials. These projects inherit from the ImageJ parent POM, which avoids repeated boilerplate configuration sections.
We plan to begin submitting builds of ImageJ2 to Maven Central soon.
For more information about using Maven with ImageJ, see:
http://imagej.net/Maven
You can find the ImageJ maven dependencies at mvnrepository.com.
Listed versions are 1.40 - 1.46.
You might be searching for this snippet?
<dependency>
<groupId>net.imagej</groupId>
<artifactId>ij</artifactId>
<version>[1.45s,)</version>
</dependency>
Found it here. There might be other useful maven snippets for you as well.
Related
Consider I have made a custom Gradle plug-in which is available at https://repo.example.com/xyz and gets applied as follows:
// build.gradle.kts
buildscript {
repositories {
jcenter()
maven("https://repo.example.com/xyz")
}
dependencies {
classpath("com.example:xyz-gradle-plugin:1.2.3")
}
}
apply(plugin = "com.example.xyz")
Now consider I need my plug-in to depend on a 3rd party library (org.something:abc:4.5.6) which is only available from another custom Maven repository (say, https://repo.something.org/abc). I generate my plug-in's pom.xml accordingly:
<dependencies>
<dependency>
<groupId>org.something</groupId>
<artifactId>abc</artifactId>
<version>4.5.6</version>
<scope>compile</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>xyz</id>
<url>https://repo.example.com/xyz/</url>
</repository>
<repository>
<id>abc</id>
<url>https://repo.something.org/abc/</url>
</repository>
</repositories>
Now, when I rebuild and re-publish the plug-in, the client code which uses it fails to build, because the org.something:abc:4.5.6 library the plug-in depends upon can't be found. Apparently, the plug-in's pom.xml gets misinterpreted: the dependency information gets extracted from it while the <repositories/> section gets ignored.
The only workaround is to explicitly add maven("https://repo.something.org/abc") to the buildscript section of each project which uses my plug-in, which I would rather not force my users to.
Are there any alternative solutions?
Update: this has been reported to Gradle team as issue #8811.
Quoting the Gradle team's response:
There are actually good reasons for the behavior of Gradle:
Gradle places a lot of importance on the source of a dependency. For Gradle, org:foo:1.0 from Maven Central and org:foo:1.0 from JCenter are considered different things. This is why repository ordering and filtering matters.
Repository hijacking has been demonstrated as an attack vector and so having a system that effectively, transitively and transparently, allows dependencies to be downloaded from any repository is not safe.
Because of these reasons, this is a change that is unlikely to happen.
There are however options for your plugin:
Shadow that exotic dependency into your own plugin
Motivate the owner of that library to publish it to a well known repository, or in your plugin's repository
Configure your plugin's repository to also mirror that other repository
On the github page of Jetbrains' Exposed,a Kotlin SQL Framework, there is a link to a page where you can get the maven dependency for this library (https://bintray.com/kotlin/exposed/exposed/view#). The same dependecy can also be found on MVNRepository (https://mvnrepository.com/artifact/org.jetbrains.exposed/exposed/0.7.6).
I am using maven 3.3.9 and Intellij 2016.3.4, but maven cannot resolve this dependency. I check the ~/.m2/ directory and it seems that it is downloaded (there is a jar present). After looking at the repository I saw that there was no pom.xml and they where using Gradle.
Is it still possible to import this dependency with maven?
It is listed on mvnrepository, but artifact itself is located in Kotlin Exposed repository. You have to add link to the Exposed repository to your POM for Maven to find it.
<repositories>
<repository>
<id>exposed</id>
<name>exposed</name>
<url>https://dl.bintray.com/kotlin/exposed</url>
</repository>
</repositories>
I have Maven and Nexus configured in my project and now I need to get the latest version of JUnit into my Nexus.
If I search Nexus, it shows the latest version available on Maven Central, but how do I download it ?
I don't even know in which repository the existing JUnit lies. I have about 15 repositories in Nexus and I'm not able to really find it.
So, in short:
Where do I find my existing JUnit version in Nexus local and how?
When I do find it and want to upgrade to latest, how to do it?
Just use the search feature. For that to work nicely you will have to have remote index download configured. Once you found it the results will show in which repository it is.
What JUnit version you use will depend on the dependency declared in your build system. E.g. if you use Maven it might look like this
<dependency>
<groupId>junit</groupId>
<artifactId>junit-dep</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
In general I would suggest to read up on Nexus usage and repository manager basics in the free book Repository Management with Nexus and maybe on your build system as well. If it is Maven a good start are the Maven books at http://www.sonatype.com/Support/Books .
Disclaimer: I am co-author of the Nexus book.
I'm converting an ANT project that uses CXF into a Maven one. The problem is that this projects depends on CXF v2.2.6 and when I go to here or even here, there is no jar to download. I don't know what to do. I have the JAR but I want to use the Maven features like dependency management.
Thanks for your help
If using Ant, it likely used the cxf-bundle jar that pretty much contains all of CXF. You can just add:
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-bundle</artifactId>
<version>2.2.6</version>
</dependency>
to your new pom and it would get that jar along with all the dependencies that it would require.
It is available at Maven central. Use repo1.maven.org as your repository.
Either install it manually to your local repository or use a repository manager like Nexus.
Does anyone know if the Thrift libraries are in any Maven repository?
0.6.1 artifacts now available from main apache repo (http://repo1.maven.org/maven2)
<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
<version>0.6.1</version>
</dependency>
https://issues.apache.org/jira/browse/THRIFT-363
I'm not sure what the Thrift libraries are (next time, maybe add a link) but according to Maven Browser, there is a thrift artifact in the scala-tools repository:
<repositories>
<repository>
<id>scala-tools</id>
<url>http://scala-tools.org/repo-releases/</url>
</repository>
</repositories>
Update: I can't say much about the version (and the content) hosted in the scala-tools repository but this is very likely an artifact made available by the scala folks for their own needs. Actually, the Apache Thrift project is using Ivy and publishing the java library to a maven repository (it will be the Apache snapshots repository, see THRIFT-363) is something on which they didn't work until recently. But the issue is closed now and my understanding is that they will publish an artifact with the next release.
As of now there are not any available, you will have to include the jar in your local repository.
You can set up something like Artefactory, a local repository and add the libthrift.jar there.
http://mvnrepository.com/artifact/org.apache.thrift/libthrift
You can search Maven repository from there.