Pom-scijava 27.0.1 causes 'Error assembling JAR' during build

Hi all,

I wanted to bump my pom to 27.0.1 on an older project but have neded up on an error when building it:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:3.1.2:jar (default-jar) on project MaxInscribedCircles: Error assembling JAR: Invalid automatic module name: '' -> [Help 1]

This error does not appear when I use version 26.0.0, which is better than version 12 I was using before :sweat_smile:

Here’s the pom, in case I am doing something wrong there. I comapred it to a project I have that works with 27.0.1 but have not seen anything that could explain the error…

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
		http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.scijava</groupId>
        <artifactId>pom-scijava</artifactId>
        <version>27.0.1</version>
        <relativePath/>
    </parent>

    <groupId>ch.epfl.biop</groupId>
    <artifactId>MaxInscribedCircles</artifactId>
    <description>Mavenized Improved fit largest circle plugin</description>
    <version>1.1.0-SNAPSHOT</version>

    <name>Max Inscribed Circles</name>
    <url>http://biop.epfl.ch</url>
    <inceptionYear>2015</inceptionYear>
    <organization>
        <name>BIOP</name>
        <url>http://biop.epfl.ch</url>
    </organization>
    <licenses>
        <license>
            <name>Simplified BSD License</name>
            <distribution>repo</distribution>
        </license>
    </licenses>
    <repositories>
        <!-- NB: for project parent -->
        <repository>
            <id>imagej.public</id>
            <url>http://maven.imagej.net/content/groups/public</url>
        </repository>
    </repositories>
    <developers>
        <developer>
            <id>oburri</id>
            <name>Olivier Burri</name>
            <url>http://biop.epfl.ch/INFO_Facility.html</url>
            <roles>
                <role>lead</role>
                <role>developer</role>
                <role>debugger</role>
                <role>reviewer</role>
                <role>support</role>
                <role>maintainer</role>
            </roles>
        </developer>
    </developers>
    <contributors>
        <contributor>
            <name>Romain Guiet</name>
            <url>http://biop.epfl.ch/INFO_Facility.html</url>
            <roles>
                <role>debugger</role>
                <role>reviewer</role>
            </roles>
            <properties>
                <id>romainGuiet</id>
            </properties>
        </contributor>

    </contributors>

    <mailingLists>
        <mailingList>
            <name>N/A</name>
            <archive>N/A</archive>
        </mailingList>
    </mailingLists>

    <issueManagement>
        <system>github</system>
        <url>N/A</url>
    </issueManagement>
    <ciManagement>
        <system>N/A</system>
        <url>N/A</url>
    </ciManagement>
    <scm>
        <connection>https://c4science.ch/diffusion/1404/ijp-max-inscribed-circles.git</connection>
        <tag>HEAD</tag>
        <url>https://c4science.ch/diffusion/1404</url>
        <developerConnection>oburri</developerConnection>
    </scm>

    <properties>
        <main-class>Max_Inscribed_Circles</main-class>
        <license.licenseName>GPL3</license.licenseName>
        <license.copyrightOwners>EPFL</license.copyrightOwners>
        <scijava.app.subdirectory>plugins/BIOP</scijava.app.subdirectory>
        <scijava.app.directory>C:/Fiji</scijava.app.directory>
        <delete.other.versions>true</delete.other.versions>
    </properties>

    <dependencies>
        <dependency>
            <groupId>fiji</groupId>
            <artifactId>fiji-plugins</artifactId>
            <version>20101208</version>
        </dependency>
        <dependency>
            <groupId>net.imagej</groupId>
            <artifactId>imagej</artifactId>
        </dependency>
        <dependency>
            <groupId>net.imagej</groupId>
            <artifactId>imagej-legacy</artifactId>
        </dependency>
    </dependencies>

</project>

Any help appreciated

Oli

I came across the same problem. I could fix it by specifying a package name in the properties section of my pom.xml. For your pom.xml this might look like this:

    <properties>
        <package-name>ch.epfl.biop.something</package-name>
        <main-class>Max_Inscribed_Circles</main-class>
        ...
    </properties>
3 Likes

This bug is fixed in pom-scijava-base version 9.0.0. But a new pom-scijava release based on that base has not yet been released. It will be released ASAP, as soon as a couple of remaining loose ends are ironed out between the imagej-ops and imagej-scripting components.

In the meantime, as @maarzt points out, a good way to avoid the bug is to simply specify your project’s package prefix using the package-name property.

3 Likes