File not found: META-INF/json/org.scijava.plugin.Plugin

imagej

#1

Hi All,

I am using maven > install on this pom: https://github.com/tischi/fiji-plugin-imageRegistration/blob/master/pom.xml
…and I am getting below error.

@haesleinhuepf was so kind to test it and he does not get this error when he clones the repo onto his computer. My feeling is that the problem is that I changed class and package names during development and that there are somewhere traces of the old stuff confusing the compilation…

INFO] --- maven-compiler-plugin:3.6.0:compile (default-compile) @ fiji-plugin-imageRegistration ---
[INFO] Compiling 40 source files to /Users/tischer/Documents/fiji-plugin-imageRegistration/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] java.nio.file.NoSuchFileException: /Users/tischer/Documents/fiji-plugin-imageRegistration/target/classes/META-INF/json/org.scijava.plugin.Plugin
 	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
 	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)

#2

Hi @Christian_Tischer,

if you rename classes marked as @ Plugin, you may need to execute

mvn clean

Does this help?

Cheers,
Robert


#3

Hi @haesleinhuepf,
I tried maven > clean already but it did not help.
Best, Tischi


#4

Turns out I did not have to change anything inside by development environment, but reinstall the Fiji that was the target of the maven install. Now it works.


#5

Hello,

I have now some more insights on this:

  • If I run maven clean it cleans the target folder and thereby removes the file target/classes/META-INF/json/org.scijava.plugin.Plugin
  • Then running maven compile produces the error, indicating the maven compile itself is not able to generate the file.
  • If however I go to Build Project within IntelliJ it does generate the target/classes/META-INF/json/org.scijava.plugin.Plugin file and everything works fine.

So somehow Build Project in IntelliJ is doing something that my maven itself at the moment cannot do by itself. Sorry for asking such beginner questions…

Can someone help?


#6

This should not be necessary, and I just successfully used mvn clean install from the command line after cloning your repository. No need to use any IDE to get the compilation right.

What’s your maven version on the CLI?


#7

Running “Execute maven goal” “clean install” within IntelliJ gives me this output:

/Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home/bin/java -Dmaven.multiModuleProjectDirectory=/Users/tischer/Documents/fiji-plugin-imageRegistration "-Dmaven.home=/Applications/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven3" "-Dclassworlds.conf=/Applications/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven3/bin/m2.conf" "-javaagent:/Applications/IntelliJ IDEA CE.app/Contents/lib/idea_rt.jar=60219:/Applications/IntelliJ IDEA CE.app/Contents/bin" -Dfile.encoding=UTF-8 -classpath "/Applications/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven3/boot/plexus-classworlds-2.5.2.jar" org.codehaus.classworlds.Launcher -Didea.version=2017.3.4 clean install
[INFO] Scanning for projects...
Downloading: https://maven.imagej.net/content/groups/public/org/scijava/pom-scijava/19.2.1-SNAPSHOT/maven-metadata.xml
Downloaded: https://maven.imagej.net/content/groups/public/org/scijava/pom-scijava/19.2.1-SNAPSHOT/maven-metadata.xml (601 B at 0.4 KB/sec)
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Fiji plugin for n-dimensional image sequence registration 0.2.3
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ fiji-plugin-imageRegistration ---
[INFO] Deleting /Users/tischer/Documents/fiji-plugin-imageRegistration/target
[INFO] 
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-rules) @ fiji-plugin-imageRegistration ---
[INFO] Skipping Rule Enforcement.
[INFO] 
[INFO] --- build-helper-maven-plugin:1.12:regex-property (sanitize-version) @ fiji-plugin-imageRegistration ---
[INFO] 
[INFO] --- buildnumber-maven-plugin:1.4:create (default) @ fiji-plugin-imageRegistration ---
[INFO] Executing: /bin/sh -c cd '/Users/tischer/Documents/fiji-plugin-imageRegistration' && 'git' 'rev-parse' '--verify' 'HEAD'
[INFO] Working directory: /Users/tischer/Documents/fiji-plugin-imageRegistration
[INFO] Storing buildNumber: 5d728afa27139d2765e0a0d633372aef5b479d6d at timestamp: 1518001012455
[INFO] Storing buildScmBranch: master
[INFO] 
[INFO] --- scijava-maven-plugin:1.0.0:set-rootdir (set-rootdir) @ fiji-plugin-imageRegistration ---
[INFO] Setting rootdir: /Users/tischer/Documents/fiji-plugin-imageRegistration
[INFO] 
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ fiji-plugin-imageRegistration ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ fiji-plugin-imageRegistration ---
[INFO] Compiling 47 source files to /Users/tischer/Documents/fiji-plugin-imageRegistration/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] java.nio.file.NoSuchFileException: /Users/tischer/Documents/fiji-plugin-imageRegistration/target/classes/META-INF/json/org.scijava.plugin.Plugin

Does that help or do you need some other information?


#8

With maven version I meant the command line output from:

mvn --version

Could you try whether compiling with a Java 8 JDK works for you?


#9
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: /Applications/IntelliJ IDEA CE.app/Contents/plugins/maven/lib/maven3
Java version: 9.0.1, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home
Default locale: en_DE, platform encoding: UTF-8
OS name: "mac os x", version: "10.13.2", arch: "x86_64", family: "mac"

regarding the JDK, I recently updated it because I think the latest pom-scijava did not work otherwise…again, please forgive me if my statements are not making always sense as I am still relatively new to the whole java and maven et al. business.


#10

I can confirm that the latest release of pom-scijava (19.2.0) works absolutely fine with Java 8. Please try using Java 8 to rule out that this issue is related to the Java version.


#11

No in my case:

$ java -version                                                                   
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
$ mvn --version                                                                   
Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 9-internal, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-9-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.10.0-42-generic", arch: "amd64", family: "unix"
$ mvn clean install                                                               
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building ImageJ 2.0.0-rc-65
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ imagej ---
[INFO] Deleting ~/imagej-imagej-2.0.0-rc-65/target
[INFO] 
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-rules) @ imagej ---
[INFO] 
[INFO] --- build-helper-maven-plugin:1.12:regex-property (sanitize-version) @ imagej ---
[INFO] 
[INFO] --- buildnumber-maven-plugin:1.4:create (default) @ imagej ---
[INFO] Executing: /bin/sh -c cd '~/imagej-imagej-2.0.0-rc-65' && 'git' 'rev-parse' '--verify' 'HEAD'
[INFO] Working directory: ~/imagej-imagej-2.0.0-rc-65
[INFO] Storing buildNumber: UNKNOWN at timestamp: 1518103583043
[WARNING] Cannot get the branch information from the git repository: 
Detecting the current branch failed: fatal: Not a git repository (or any of the parent directories): .git

[INFO] Executing: /bin/sh -c cd '~/imagej-imagej-2.0.0-rc-65' && 'git' 'rev-parse' '--verify' 'HEAD'
[INFO] Working directory: ~/imagej-imagej-2.0.0-rc-65
[INFO] Storing buildScmBranch: UNKNOWN_BRANCH
[INFO] 
[INFO] --- scijava-maven-plugin:1.0.0:set-rootdir (set-rootdir) @ imagej ---
[INFO] Setting rootdir: ~/imagej-imagej-2.0.0-rc-65
[INFO] 
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ imagej ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory ~/imagej-imagej-2.0.0-rc-65/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ imagej ---
[INFO] Compiling 3 source files to ~/imagej-imagej-2.0.0-rc-65/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] java.nio.file.NoSuchFileException: ~/imagej-imagej-2.0.0-rc-65/target/classes/META-INF/json/org.scijava.plugin.Plugin
  	at sun.nio.fs.UnixException.translateToIOException(java.base@9-internal/UnixException.java:92)
  	at sun.nio.fs.UnixException.rethrowAsIOException(java.base@9-internal/UnixException.java:111)
  	at sun.nio.fs.UnixException.rethrowAsIOException(java.base@9-internal/UnixException.java:116)
  	at sun.nio.fs.UnixFileSystemProvider.newByteChannel(java.base@9-internal/UnixFileSystemProvider.java:215)
  	at java.nio.file.Files.newByteChannel(java.base@9-internal/Files.java:362)
  	at java.nio.file.Files.newByteChannel(java.base@9-internal/Files.java:408)
  	at java.nio.file.spi.FileSystemProvider.newInputStream(java.base@9-internal/FileSystemProvider.java:384)
  	at java.nio.file.Files.newInputStream(java.base@9-internal/Files.java:152)
  	at com.sun.tools.javac.file.PathFileObject.openInputStream(jdk.compiler@9-internal/PathFileObject.java:436)
  	at javax.tools.ForwardingFileObject.openInputStream(java.compiler@9-internal/ForwardingFileObject.java:74)
  	at org.scijava.annotations.AnnotationProcessor$Writer.openInput(AnnotationProcessor.java:235)
  	at org.scijava.annotations.AbstractIndexWriter.merge(AbstractIndexWriter.java:126)
  	at org.scijava.annotations.AbstractIndexWriter.write(AbstractIndexWriter.java:99)
  	at org.scijava.annotations.AnnotationProcessor.process(AnnotationProcessor.java:95)
  	at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(jdk.compiler@9-internal/JavacProcessingEnvironment.java:958)
  	at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(jdk.compiler@9-internal/JavacProcessingEnvironment.java:874)
  	at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$2100(jdk.compiler@9-internal/JavacProcessingEnvironment.java:106)
  	at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(jdk.compiler@9-internal/JavacProcessingEnvironment.java:1181)
  	at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(jdk.compiler@9-internal/JavacProcessingEnvironment.java:1289)
  	at com.sun.tools.javac.main.JavaCompiler.processAnnotations(jdk.compiler@9-internal/JavaCompiler.java:1229)
  	at com.sun.tools.javac.main.JavaCompiler.compile(jdk.compiler@9-internal/JavaCompiler.java:903)
  	at com.sun.tools.javac.api.JavacTaskImpl$1.call(jdk.compiler@9-internal/JavacTaskImpl.java:104)
  	at com.sun.tools.javac.api.JavacTaskImpl$1.call(jdk.compiler@9-internal/JavacTaskImpl.java:100)
  	at com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(jdk.compiler@9-internal/JavacTaskImpl.java:135)
  	at com.sun.tools.javac.api.JavacTaskImpl.doCall(jdk.compiler@9-internal/JavacTaskImpl.java:100)
  	at com.sun.tools.javac.api.JavacTaskImpl.call(jdk.compiler@9-internal/JavacTaskImpl.java:94)
  	at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:126)
  	at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:174)
  	at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:1075)
  	at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:168)
  	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
  	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
  	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
  	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
  	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
  	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
  	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:307)
  	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
  	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
  	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
  	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
  	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
  	at sun.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-internal/Native Method)
  	at sun.reflect.NativeMethodAccessorImpl.invoke(java.base@9-internal/NativeMethodAccessorImpl.java:62)
  	at sun.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-internal/DelegatingMethodAccessorImpl.java:43)
  	at java.lang.reflect.Method.invoke(java.base@9-internal/Method.java:531)
  	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)
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.463 s
[INFO] Finished at: 2018-02-08T17:26:23+02:00
[INFO] Final Memory: 33M/110M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project imagej: Compilation failure
[ERROR] java.nio.file.NoSuchFileException: ~/imagej-imagej-2.0.0-rc-65/target/classes/META-INF/json/org.scijava.plugin.Plugin
[ERROR] at sun.nio.fs.UnixException.translateToIOException(java.base@9-internal/UnixException.java:92)
[ERROR] at sun.nio.fs.UnixException.rethrowAsIOException(java.base@9-internal/UnixException.java:111)
[ERROR] at sun.nio.fs.UnixException.rethrowAsIOException(java.base@9-internal/UnixException.java:116)
[ERROR] at sun.nio.fs.UnixFileSystemProvider.newByteChannel(java.base@9-internal/UnixFileSystemProvider.java:215)
[ERROR] at java.nio.file.Files.newByteChannel(java.base@9-internal/Files.java:362)
[ERROR] at java.nio.file.Files.newByteChannel(java.base@9-internal/Files.java:408)
[ERROR] at java.nio.file.spi.FileSystemProvider.newInputStream(java.base@9-internal/FileSystemProvider.java:384)
[ERROR] at java.nio.file.Files.newInputStream(java.base@9-internal/Files.java:152)
[ERROR] at com.sun.tools.javac.file.PathFileObject.openInputStream(jdk.compiler@9-internal/PathFileObject.java:436)
[ERROR] at javax.tools.ForwardingFileObject.openInputStream(java.compiler@9-internal/ForwardingFileObject.java:74)
[ERROR] at org.scijava.annotations.AnnotationProcessor$Writer.openInput(AnnotationProcessor.java:235)
[ERROR] at org.scijava.annotations.AbstractIndexWriter.merge(AbstractIndexWriter.java:126)
[ERROR] at org.scijava.annotations.AbstractIndexWriter.write(AbstractIndexWriter.java:99)
[ERROR] at org.scijava.annotations.AnnotationProcessor.process(AnnotationProcessor.java:95)
[ERROR] at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(jdk.compiler@9-internal/JavacProcessingEnvironment.java:958)
[ERROR] at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(jdk.compiler@9-internal/JavacProcessingEnvironment.java:874)
[ERROR] at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$2100(jdk.compiler@9-internal/JavacProcessingEnvironment.java:106)
[ERROR] at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(jdk.compiler@9-internal/JavacProcessingEnvironment.java:1181)
[ERROR] at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(jdk.compiler@9-internal/JavacProcessingEnvironment.java:1289)
[ERROR] at com.sun.tools.javac.main.JavaCompiler.processAnnotations(jdk.compiler@9-internal/JavaCompiler.java:1229)
[ERROR] at com.sun.tools.javac.main.JavaCompiler.compile(jdk.compiler@9-internal/JavaCompiler.java:903)
[ERROR] at com.sun.tools.javac.api.JavacTaskImpl$1.call(jdk.compiler@9-internal/JavacTaskImpl.java:104)
[ERROR] at com.sun.tools.javac.api.JavacTaskImpl$1.call(jdk.compiler@9-internal/JavacTaskImpl.java:100)
[ERROR] at com.sun.tools.javac.api.JavacTaskImpl.handleExceptions(jdk.compiler@9-internal/JavacTaskImpl.java:135)
[ERROR] at com.sun.tools.javac.api.JavacTaskImpl.doCall(jdk.compiler@9-internal/JavacTaskImpl.java:100)
[ERROR] at com.sun.tools.javac.api.JavacTaskImpl.call(jdk.compiler@9-internal/JavacTaskImpl.java:94)
[ERROR] at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess(JavaxToolsCompiler.java:126)
[ERROR] at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:174)
[ERROR] at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:1075)
[ERROR] at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:168)
[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-internal/Native Method)
[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(java.base@9-internal/NativeMethodAccessorImpl.java:62)
[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-internal/DelegatingMethodAccessorImpl.java:43)
[ERROR] at java.lang.reflect.Method.invoke(java.base@9-internal/Method.java:531)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

doesn’t work either with master HEAD (da260c1)


#12

So your maven is using Java 9 actually. Can you test if using Java 8 (e.g. by setting your JAVA_HOME accordingly) makes it work?


#13

JDK 8 works indeed. Thanks for the tip!

Below a screenshot of my settings for other IntelliJ people :slight_smile:


#14

Right, that helps. Just a note I have to set JAVA_HOME in ~/.mavenrc not simply in shell. Some errors occur when running some tests, but I think the building was successful:

$ mvn clean install                                                               
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building ImageJ 2.0.0-rc-65
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ imagej ---
[INFO] Deleting ~/imagej-imagej-2.0.0-rc-65/target
[INFO] 
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-rules) @ imagej ---
[INFO] 
[INFO] --- build-helper-maven-plugin:1.12:regex-property (sanitize-version) @ imagej ---
[INFO] 
[INFO] --- buildnumber-maven-plugin:1.4:create (default) @ imagej ---
[INFO] Executing: /bin/sh -c cd '~/imagej-imagej-2.0.0-rc-65' && 'git' 'rev-parse' '--verify' 'HEAD'
[INFO] Working directory: ~/imagej-imagej-2.0.0-rc-65
[INFO] Storing buildNumber: UNKNOWN at timestamp: 1518165010046
[WARNING] Cannot get the branch information from the git repository: 
Detecting the current branch failed: fatal: Not a git repository (or any of the parent directories): .git

[INFO] Executing: /bin/sh -c cd '~/imagej-imagej-2.0.0-rc-65' && 'git' 'rev-parse' '--verify' 'HEAD'
[INFO] Working directory: ~/imagej-imagej-2.0.0-rc-65
[INFO] Storing buildScmBranch: UNKNOWN_BRANCH
[INFO] 
[INFO] --- scijava-maven-plugin:1.0.0:set-rootdir (set-rootdir) @ imagej ---
[INFO] Setting rootdir: ~/imagej-imagej-2.0.0-rc-65
[INFO] 
[INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ imagej ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory ~/imagej-imagej-2.0.0-rc-65/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ imagej ---
[INFO] Compiling 3 source files to ~/imagej-imagej-2.0.0-rc-65/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ imagej ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory ~/imagej-imagej-2.0.0-rc-65/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ imagej ---
[INFO] Compiling 4 source files to ~/imagej-imagej-2.0.0-rc-65/target/test-classes
[INFO] 
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ imagej ---

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running net.imagej.app.ServiceCompletenessTest
[ECLIPSE HELPER] Indexing annotations...
log4j:WARN No appenders could be found for logger (org.bushe.swing.event.EventService).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 4.817 sec - in net.imagej.app.ServiceCompletenessTest
Running net.imagej.app.MainTest
[ERROR] null
java.rmi.NoSuchObjectException: no such object in table
	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:283)
	at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:260)
	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:161)
	at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:227)
	at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:179)
	at net.imagej.legacy.$Proxy15.sendArgument(Unknown Source)
	at net.imagej.legacy.SingleInstance.sendArguments(SingleInstance.java:203)
	at net.imagej.legacy.SingleInstance.sendArguments(SingleInstance.java:168)
	at net.imagej.legacy.LegacyConsoleService.processArgs(LegacyConsoleService.java:73)
	at org.scijava.AbstractGateway.launch(AbstractGateway.java:96)
	at net.imagej.app.MainTest.testHeadless(MainTest.java:74)
	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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161)
	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
[ERROR] Could not connect to existing ImageJ instance. If problem persists, please delete file: /tmp/ImageJ-linzi-_0-7.stub
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.287 sec - in net.imagej.app.MainTest
Running net.imagej.app.ToplevelImageJAppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.541 sec - in net.imagej.app.ToplevelImageJAppTest

Results :

Tests run: 5, Failures: 0, Errors: 0, Skipped: 0

[INFO] 
[INFO] --- maven-jar-plugin:2.6:jar (default-jar) @ imagej ---
[INFO] Building jar: ~/imagej-imagej-2.0.0-rc-65/target/imagej-2.0.0-rc-65.jar
[INFO] 
[INFO] >>> maven-source-plugin:3.0.1:jar (attach-sources) > generate-sources @ imagej >>>
[INFO] 
[INFO] --- maven-enforcer-plugin:1.4.1:enforce (enforce-rules) @ imagej ---
[INFO] 
[INFO] --- build-helper-maven-plugin:1.12:regex-property (sanitize-version) @ imagej ---
[INFO] 
[INFO] --- buildnumber-maven-plugin:1.4:create (default) @ imagej ---
[INFO] 
[INFO] --- scijava-maven-plugin:1.0.0:set-rootdir (set-rootdir) @ imagej ---
[INFO] 
[INFO] <<< maven-source-plugin:3.0.1:jar (attach-sources) < generate-sources @ imagej <<<
[INFO] 
[INFO] --- maven-source-plugin:3.0.1:jar (attach-sources) @ imagej ---
[INFO] Building jar: ~/imagej-imagej-2.0.0-rc-65/target/imagej-2.0.0-rc-65-sources.jar
[INFO] 
[INFO] --- maven-jar-plugin:2.6:test-jar (default) @ imagej ---
[INFO] Building jar: ~/imagej-imagej-2.0.0-rc-65/target/imagej-2.0.0-rc-65-tests.jar
[INFO] 
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ imagej ---
[INFO] Installing ~/imagej-imagej-2.0.0-rc-65/target/imagej-2.0.0-rc-65.jar to /home/linzi/.m2/repository/net/imagej/imagej/2.0.0-rc-65/imagej-2.0.0-rc-65.jar
[INFO] Installing ~/imagej-imagej-2.0.0-rc-65/pom.xml to /home/linzi/.m2/repository/net/imagej/imagej/2.0.0-rc-65/imagej-2.0.0-rc-65.pom
[INFO] Installing ~/imagej-imagej-2.0.0-rc-65/target/imagej-2.0.0-rc-65-sources.jar to /home/linzi/.m2/repository/net/imagej/imagej/2.0.0-rc-65/imagej-2.0.0-rc-65-sources.jar
[INFO] Installing ~/imagej-imagej-2.0.0-rc-65/target/imagej-2.0.0-rc-65-tests.jar to /home/linzi/.m2/repository/net/imagej/imagej/2.0.0-rc-65/imagej-2.0.0-rc-65-tests.jar
[INFO] 
[INFO] --- imagej-maven-plugin:0.6.0:copy-jars (copy-jars) @ imagej ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.448 s
[INFO] Finished at: 2018-02-09T10:30:24+02:00
[INFO] Final Memory: 75M/2337M
[INFO] ------------------------------------------------------------------------

#15

Thanks for checking, @ziyuan.

Apparently, the errors are expected to occur while running the tests, which is why you still get Failures: 0, Errors: 0 at the end, and your build succeeds :slight_smile:


May I ask why you’re trying to build the ImageJ main project? Most of the functionality is split into the various component projects, so usually it is sufficient to just depend on imagej/imagej in your Maven project, and there’s no need to build imagej yourself…


#16

@imagejan I am completely new to ImageJ/Maven and want to try the new ImageJ2, so I followed INSTALL.txt, which points to http://imagej.net/Source_code, and then the instructions under “Build from source” in the page. I expect I can put plugins bundled with Fiji into ImageJ2 later. Am I wrong about the steps?


#17

I you just want to use ImageJ2 functionality, I would recommend to simply download Fiji. See here for some information:


If you want to develop/contribute to a specific part of ImageJ, I recommend reading:


If you want guidance with a specific use case (both ImageJ2 usage or development), feel free to create a new topic here on the forum and describe what you’d like to achieve :slight_smile:.


#18

Yes, the ImageJ binary in Fiji works out-of-the-box. Thanks for the information!