119 bytes removed, 14:21, 30 April 2019
ImageJ Maven repository -> SciJava Maven repository, plus link fixes
{{Notice | If Maven is completely new to you, read:
* [http What is Maven?]* [http Maven in 5 Minutes]}}{{DevelopMenu | tools}}{{Minibox | logo=Maven-icon.png | size=51px | blurb=<br>'''Apache Maven''' is a [[wikipedia:Convention over configuration|convention over configuration]] build automation tool.}}[[ImageJ]], [[Fiji]] and other [[SciJava]] projects use [http Maven] for their project infrastructure.
Maven artifacts are published to the [[ImageJ SciJava Maven repository]].
= Why do we use Maven? =
Once your dependencies are declared, Maven will download them on demand from the Internet. However, for Maven to find the dependencies, it has to know where to look.
Out of the box, Maven will look in the so-called [http Maven Central repository]. Some ImageJ and SciJava components are deployed there, including the [[Architecture#Maven_component_structure|pom-scijava parent POM]] which declares important metadata, such as the [[Bill of Materials]]: current artifact versions intended to work together.
However, many other SciJava and ImageJ components are not yet deployed to Maven Central, but instead to the [[ImageJ SciJava Maven repository]]. To gain access to this repository from your project, add the following configuration block to your ''pom.xml'':
<source lang="xml">
<!-- NB: for project parent -->
<id>imagejscijava.public</id> <url>httphttps://maven.imagejscijava.netorg/content/groups/public</url>
As a rule of thumb: components [[Versioning|versioned at 0.x]] are deployed to the ImageJ SciJava Maven repository, while those at 1.x or later are deployed to Maven Central.
== Releases and snapshots ==
= How to find a dependency's groupId/artifactId/version (GAV)? =
Most popular open source libraries upon which you might want to depend are stored in the [http Maven Central repository]. However, the ImageJ and Fiji JARs are not yet stored there, but in the [[Architecture#Maven_repositories|ImageJ SciJava Maven repository]]. Fortunately, you can search both at once, by visiting:
For example, let's suppose you want to depend on the [ snakeyaml] library. Typing "snakeyaml" into the search box at [http org maven.imagejscijava.netorg] tells us to use a <code>groupId</code> of <code>org.yaml</code>, <code>artifactId</code> of <code>snakeyaml</code>, with available versions ranging from <code>1.4</code> to <code>1.10</code>. In the case of many results, you can click the "Drill down" link to view more details of that specific GAV combination. You can also click an entry to get a formatted <code>dependency</code> block for direct copy-pasting into your POM.
{{Tip | tip=If your dependencies are in Maven Central, you can use the [ quickdeps] tool to quickly generate dependency blocks, by scanning your project's bytecode.}}
= Depending on libraries outside the core repositories =
If you need to depend on a library that is not present in either Maven Central or the ImageJ SciJava Maven repository, first double check the project's web site for any documentation on using their library with Maven. They might provide their own public Maven repository which you could use instead (by [http adding a <code>&lt;repository&gt;</code> to the <code>&lt;repositories&gt;</code> section of your POM]).
If there are no public repositories containing your dependency, you have two options:
* If the dependency is itself an ImageJ plugin, consider [[Fiji_contribution_requirements|contributing it to Fiji]]. Plugins distributed with Fiji are [[Fiji_contribution_requirements#Maven_artifacts|made available as Maven artifacts]], and thus will benefit both users and developers.
* If the dependency is narrower in scope, you could [[Mailing Lists|contact the ImageJ & Fiji maintainers]] to get your needed dependency added to the ImageJ SciJava Maven repository. Note that you will then be responsible for distributing the dependency with your code—so ensure it is [[Licensing|licensed appropriately]].
Finally, for local testing you can [http install the dependency into your local Maven repository cache yourself]. The command is <code>mvn install:install-file</code>. For example, if you have a library <code>foo.jar</code> to install, you could run:
mvn install:install-file -Dfile=/path/to/foo.jar \
* Our very own [[Maven - Frequently Asked Questions|Maven FAQ]]
* [http Maven's Getting Started]* [http Maven: The Complete Reference]* [http Maven by Example]* [ Nexus Book: Repository Management with Nexus]
Bureaucrat, emailconfirmed, incoming, administrator, uploaders