Giter Site home page Giter Site logo

imagej-maven-plugin's Introduction

ImageJ

ImageJ is public domain software for processing and analyzing scientific images.

It is written in Java, which allows it to run on many different platforms.

For further information, see:

Using ImageJ as a dependency

To use ImageJ as a library in your Maven project, add the dependency:

<dependency>
  <groupId>net.imagej</groupId>
  <artifactId>ij</artifactId>
  <version>1.53j</version>
</dependency>

Where 1.53j is the version of ImageJ you would like to use:

Building from source

With Ant

The Apache Ant utility will compile and run ImageJ using the build.xml file in this directory. There is a version of Ant at

https://imagej.nih.gov/ij/download/tools/ant/ant.zip

set up to use the JVM distributed with the Windows version of ImageJ. The README included in the ZIP archive has more information.

With Maven

You can compile and run ImageJ using the Maven build tool:

Command Action
mvn Compile and package ImageJ into a JAR file in the target directory.
mvn -Pexec Compile and then run ImageJ.
mvn javadoc:javadoc Generate the project Javadoc in the target/apidocs directory.

imagej-maven-plugin's People

Contributors

awalter17 avatar ctrueden avatar dependabot[bot] avatar dscho avatar hinerm avatar lacan avatar skalarproduktraum avatar stelfrich avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

imagej-maven-plugin's Issues

mvn -Dimagej.app.directory=… for plugins requires _ in name

mvn -Dimagej.app.directory=/home/me/Fiji.app install

for plugins that have a

<name>plugins/myPlugin.jar</name>

does not copy the target into

/home/me/Fiji.app/plugins

but into

/home/me/Fiji.app/jars

whereas

<name>plugins/my_Plugin.jar</name>

would be copied into

/home/me/Fiji.app/plugins

If I understood @rasband correctly, _ is not required any more to recognize plugins. If that is true, it should not be required by the copy rule either.

Ignore excluded dependencies

We have not used any <exclusions> blocks in our dependency declarations... until today. Now that we have need to exclude some transitive dependencies in this way (specifically: the gov.nih.imagej:imagej artifact from the ome:bio-formats_plugins dependency), it would be nice if imagej-maven-plugin respected such exclusions and did not copy excluded transitive dependencies into the jars or plugins folders.

Improve log messages for incompatible versions

Currently, the log message does not contain the name of the artifact for which an incompatible version exists.

[WARNING] Found other version that is incompatible according to SemVer.

Make imagej.app.directory outisde of pom.xml ?

I would like to not track imagej.app.directory property by git by putting it outside the pom.xml file. I am using Netbeans for development and so a method compatible with it would be nice :-)

Any idea ?

Expand copy-jars to also copy non-JAR resources

A Maven project such as imagej/imagej or fiji/fiji should be able to put scripts and other non-JAR resources somewhere (maybe src/main/imagej by default), such that they will get copied by the imagej-maven-plugin into an ImageJ installation when one is provided via the imagej.app.directory property.

Multi-module projects do not work(?)

Try building BoneJ2 with an imagej.app.directory set and pom-scijava >= 21.0.0. (Specifically: imagej-maven-plugin 0.7.0 rather than 0.6.0.) The build fails with the following error:

[ERROR] Failed to execute goal net.imagej:imagej-maven-plugin:0.7.0:copy-jars (copy-jars) on project pom-bonej2: Couldn't resolve dependencies for artifact: org.eclipse.aether.resolution.DependencyResolutionException: Could not find artifact org.bonej:pom-bonej2:jar:0.4.0-SNAPSHOT in imagej.public (http://maven.imagej.net/content/groups/public) -> [Help 1]

Running mvn -DskipTests clean install first does not alleviate the issue.

See also this conversation on Gitter.

NPE when copying dependencies for fiji/fiji

One the current fiji/fiji master branch (fiji/fiji@969b2d4), running mvn -X -Dimagej.app.directory=Fiji.app fails to copy the dependencies, producing the following failure:

[ERROR] Failed to execute goal net.imagej:imagej-maven-plugin:0.7.0:copy-jars (copy-jars) on project fiji: Execution copy-jars of goal net.imagej:imagej-maven-plugin:0.7.0:copy-jars failed.: NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal net.imagej:imagej-maven-plugin:0.7.0:copy-jars (copy-jars) on project fiji: Execution copy-jars of goal net.imagej:imagej-maven-plugin:0.7.0:copy-jars failed.
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution copy-jars of goal net.imagej:imagej-maven-plugin:0.7.0:copy-jars failed.
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:145)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.lang.NullPointerException
    at net.imagej.maven.AbstractCopyJarsMojo.installArtifact (AbstractCopyJarsMojo.java:183)
    at net.imagej.maven.AbstractCopyJarsMojo.installArtifact (AbstractCopyJarsMojo.java:139)
    at net.imagej.maven.CopyJarsMojo.execute (CopyJarsMojo.java:188)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)

Using imagej-maven-plugin 0.6.0 does not have this problem, but then does not benefit from the improved dependency handling.

Improve detection of other versions

Currently, there is a filename/regex-based check for determining if a file in imagej.app.directory conflicts with the artifact to be installed. While this check works, it has hardcoded patterns and is thus not extensible if e.g. artifacts with new architectures show up.

We (@ctrueden and I) have come up with the following scheme to extract the version and qualifier from a Jar file:

  1. Look in Jar for version information:
    1. pom.xml in META-INF (if found, return)
    2. MANIFEST.mf (implementation version)
  2. If the version is found in the filename suffix, the rest is a qualifier [If not: ij.jar or inconsistent: warning]
  3. If nothing is in the filename
    1. use regex (dash+digit: substring)
    2. if there is no version, assume there is a qualifier or suffix

Add -Ddelete.older.versions flag

Probably named -Dimagej.deleteOlderVersions actually, but we need functionality like delete.other.versions but only when the existing libraries are older according to SemVer.

Add goal for uploading to an ImageJ update site

Right now, to automate uploads to update sites, the easiest way is to bootstrap an ImageJ2 installation—typically by downloading a platform-specific Fiji bundle and unpacking it—and then copy stuff into the installation and use the command line ImageJ updater to upload everything. Unfortunately, there have been reports (e.g., this one from @tferr) of difficulties with this approach.

Much better would be if it could be done directly from your Maven component: mvn imagej:upload.

Thanks to @hadim for the idea.

Add flag to disable copying of dependencies

Currently, copy-jars as well as install-artifact handle the artifact and its dependencies in the same way. Sometimes it would be useful to just install the artifact itself and ignore dependencies (suggested by @ctrueden).

Teach copy-jars about `nar` artifacts

When encountering a nar artifact, we should not just ignore it, but rather download it, then look for all platforms known to ImageJ (win32, win64, linux32, linux64 and macosx) and copy the respective attached artifacts -- insofar present -- into the lib/<platform>/ subdirectory.

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.