| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
The pom-scijava-base project is a Maven POM that serves as the base for all Maven-based SciJava software, including:
| Fiji | ImageJ2 | ImgLib2 | KNIME | LOCI | SCIFIO | SciJava | FLIMLib | Virtual Cell |
|---|---|---|---|---|---|---|---|---|
It is encouraged that you not extend this POM directly, and instead use pom-scijava as parent.
| pom-scijava-base | pom-scijava |
|---|---|
| "Low level" base POM, without dependency version management. Extend pom-scijava-base only if you are a Maven expert, and have good reasons for doing so. | Friendly base POM for SciJava software, including dependency version management. Extend pom-scijava to inherit the unified SciJava Bill of Materials: component versions which have been tested to work together. |
See these examples for guidance:
The pom-scijava-base parent POM declares several enforcer rules which we believe make SciJava-based projects more reproducible and more consistent:
Plugin versions. Out of the box, Maven does not require plugins used to declare a version. But plugin versions must be declared to ensure reproducible builds. Otherwise, the version of Maven core you use at build time will determine which plugin versions are used, and the behavior might differ between builds.
No duplicate classes. If two dependencies define the same class, then it introduces the possibility of serious class-loading issues. Which version of the class should be chosen? In some scenarios, classes from one part of a certain library may be loaded from dependency foo, but classes from a different part of that same library at a different version may be loaded from dependency bar. When this happens, difficult-to-understand compiler errors, or even runtime errors, may occur. Best practice is to ensure that all classes come onto the classpath from exactly one source.
No too-new dependencies. When a project is compiled for Java version X, then it may not use any dependencies which require a version newer than X. Otherwise, your project is lying about needing only version X.
No circular dependencies. Actually, this is a central rule of Maven. But we configure the Enforcer to explicitly check for it, just to be safe. It is always possible to avoid circular dependencies; if you feel like you need one, you should instead solve it in one of the following ways, depending on how much code is co-dependent:
Reproducible builds. This rule means no SNAPSHOT dependencies, no SNAPSHOT parents, and no SNAPSHOT plugin versions. A snapshot version is not immutable, which means that code which depends on a snapshot may build today, but not build tomorrow, if the snapshot is later changed. The best way to avoid this conundrum is to never depend on SNAPSHOT versions. Snapshot are best used for testing only; they can be used transiently, but their use should never make it onto the main integration branch (e.g., main or master) of a project. See also Using snapshot couplings during development.
Developer roles. SciJava-based projects define developers and contributors with roles matching the SciJava team roles. Doing this is vital for consistency, and for communicating expectations to the community. By being careful about which developers are pledging which sorts of responsibility, the social status of each project becomes much clearer, and which social actions to take in various circumstances becomes a more tractable problem. We have automated tooling which can populates a statbox sidebar for any component built on SciJava, including all components of the ImageJ2 software stack; this tooling requires SciJava developer roles to be present for sensible results.
Required metadata. Every SciJava-based project must override key pieces of metadata, including the name, description, url, inceptionYear, organization, licenses, developers, contributors, mailingLists, scm, issueManagement and ciManagement elements, as well as the license.licenseName and license.copyrightOwners properties. There are several reasons for requiring these overrides:
The full set of Enforcer rules as of pom-scijava-base version 14.0.0 can be seen here.
For some projects, you may have "empty" metadata fields, and you may be unsure how best to override those values accordingly. The most common scenarios are:
<contributors>
<!--
NB: Need at least one element to override the parent.
See: https://issues.apache.org/jira/browse/MNG-5220
-->
<contributor>
<name>None</name>
</contributor>
</contributors><mailingLists>
<mailingList>
<name>None</name>
</mailingList>
</mailingLists><mailingLists>
<mailingList>
<name>Image.sc Forum</name>
<archive>https://forum.image.sc/tag/your-tag</archive>
</mailingList>
</mailingLists><ciManagement>
<system>None</system>
</ciManagement><issueManagement>
<system>None</system>
</issueManagement><scm>
<system>None</system>
<url>None</url>
</scm>For more information about Maven, see:
| Back | FazBrowse Home | New Git URL |