Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with importing packages - Maven Build #230

Open
bioramonmoratori opened this issue Nov 18, 2023 · 1 comment
Open

Problems with importing packages - Maven Build #230

bioramonmoratori opened this issue Nov 18, 2023 · 1 comment

Comments

@bioramonmoratori
Copy link

Bugs

When I tried to build the application using Maven, I encountered some import errors in the POM.xml file. The dependencies are:

  • pom-scijava: version 31.1.0
  • junit: no specific version
  • loci: missing dependency

Affected Classes and Possible Fixes

pom-scijava 31.1.0:

  • Unable to use any Maven commands.

scijava

  • Correction: Use the updated version 37.0.0
<parent>
  <groupId>org.scijava</groupId>
  <artifactId>pom-scijava</artifactId>
  <version>37.0.0</version>
  <relativePath />
</parent>

JUnit

  • Dependency import error
  • Correction with version specification 4.13.2:
<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>4.13.2</version>
  <scope>test</scope>
</dependency>

Folder /ImageJ/tests experiencing import issues with various classes:

  • Correction by using the dependency from ImageJ itself (not recommended)
<dependency>
  <groupId>net.imagej</groupId>
  <artifactId>ij</artifactId>
</dependency>

Even so, some classes from the "tests" folder cannot import the "Loci" dependency. Even after deleting these classes, many JUnit tests start to fail, and some classes show deprecation warnings.

  • I haven't found a solution for this.

What should be done:

  • Find an alternative for using the ImageJ dependency.
  • Replace the Loci dependency with another that performs the same task.

By making these changes, the expectation is that the Maven build will return to functioning normally.

@ctrueden
Copy link
Member

@bioramonmoratori Thank you for the detailed report.

Could you please comment on the versions of Maven and OpenJDK that you are using? For example, on my system:

$ mvn -v
Apache Maven 3.8.7
Maven home: /usr/share/maven
Java version: 11.0.20.1, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "6.5.0-10-generic", arch: "amd64", family: "unix"

With this combination, as well as other versions of OpenJDK I tested, I am able to build ImageJ without the problems you describe, simply by typing mvn at the command line.

Based on your screenshot above, I get the impression somehow that you are not using the Maven command line tool, but maybe some other tool? If so, what is it?

About the specific points you raise:

pom-scijava: version 31.1.0

This parent version works just fine for me. Using 37.0.0 is also fine, and we can certainly update it, but I don't believe there is an urgent reason to do so for this project.

junit: no specific version

The version of junit should not be specified here. Rather, it is inherited from the parent POM via its depenencyManagement section. This is the purpose of the SciJava Bill of Materials.

loci: missing dependency

Yes, some of the tests are currently written to use Bio-Formats to import images. This is less than ideal. However, the tests are currently disabled in the pom.xml, so these errors should not matter. I have not fixed this issue yet due to lack of time, as there are currently many failing tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants