Maven package command creates a package name with a capital letter

57 views Asked by At

This is my first ever post so appologies if I miss some conventions.

I am writing a spring framework app, which loads in components within the package "org.cascade". I have a core app called cascade-core, and a number of other maven modules that when placed in the lib folder of the app add extra functionality, e.g. cascade-distribution.0.0.1.jar, cascade-img.0.0.1.jar, ect.

All was working fine until i expanded the cascade-img.0.0.1.jar to include more classes associated with Phasor plotting. I started getting an error at start up stating that certain classes could not be read because they did not exist. After navigating the result of mvn clean package, i noticed the files did exist but the package name was changed to a capital letter.

Instead of org.cascade.phasor.paramater.PhasorDataParamater.class

the jar contained org.cascade.Phasor.paramater.PasorDataParamater.class

Somehow the 'P' in phasor is being capitalised.

Screenshot, Jar on left, source on right

Program runs fine in IDE (Eclipse) and when I look at the class file strucutre in eclipse it does not capitalise the 'p' in phasor. Therefore I think it has something to do with the maven build, but can't find anything on it.

Here is my POM

<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.cascade</groupId>
    <artifactId>cascade-pom</artifactId>
    <version>0.0.1</version>
  </parent>
  <artifactId>cascade-img</artifactId>

  <dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter</artifactId>
    </dependency>
    <dependency>
        <groupId>org.cascade</groupId>
        <artifactId>cascade-core</artifactId>
        <version>0.0.1</version>
    </dependency>
    <dependency>
        <groupId>ome</groupId>
        <artifactId>formats-gpl</artifactId>
    </dependency>
    <dependency>
        <groupId>ome</groupId>
        <artifactId>formats-api</artifactId>
    </dependency>
    <dependency>
        <groupId>ome</groupId>
        <artifactId>formats-bsd</artifactId>
    </dependency>
    <dependency>
        <groupId>net.imglib2</groupId>
        <artifactId>imglib2</artifactId>
    </dependency>
    <dependency>
        <groupId>io.scif</groupId>
        <artifactId>scifio</artifactId>
    </dependency>
    <dependency>
        <groupId>org.controlsfx</groupId>
        <artifactId>controlsfx</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-math3</artifactId>
    </dependency>
    <dependency>
        <groupId>ai.djl</groupId>
        <artifactId>api</artifactId>
    </dependency>
    <dependency>
        <groupId>de.jensd</groupId>
        <artifactId>fontawesomefx-materialdesignfont</artifactId>
    </dependency>
    <dependency>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-swing</artifactId>
    </dependency>
    <dependency>
        <groupId>net.imglib2</groupId>
        <artifactId>imglib2-ij</artifactId>
    </dependency>
    <dependency>
        <groupId>net.imglib2</groupId>
        <artifactId>imglib2-algorithm</artifactId>
        <version>0.12.1</version>
    </dependency>
    <dependency>
        <groupId>net.imagej</groupId>
        <artifactId>imagej-ops</artifactId>
    </dependency>
    <dependency>
            <groupId>net.imglib2</groupId>
            <artifactId>imglib2-roi</artifactId>
            <version>0.8.0</version>
    </dependency>
    <dependency>
            <groupId>net.imglib2</groupId>
            <artifactId>imglib2-realtransform</artifactId>
            <version>3.1.2</version>
    </dependency>
    <dependency>
        <groupId>io.scif</groupId>
        <artifactId>scifio-bf-compat</artifactId>
    </dependency>
    <dependency>
        <groupId>net.imglib2</groupId>
        <artifactId>imglib2-cache</artifactId>
    </dependency>
    <dependency>
        <groupId>org.kordamp.ikonli</groupId>
        <artifactId>ikonli-materialdesign2-pack</artifactId>
    </dependency>
    <dependency>
        <groupId>ome</groupId>
        <artifactId>jxrlib-all</artifactId>
    </dependency>
    <dependency>
        <groupId>org.jogamp.jogl</groupId>
        <artifactId>jogl-all-main</artifactId>
    </dependency>
    <dependency>
        <groupId>net.imagej</groupId>
        <artifactId>imagej</artifactId>
        <version>2.13.1</version>
    </dependency>
  </dependencies>
</project>

I have tried looking as to see what maven properties could be resulting in a single capitalisation in the package path, but not found any explanation. I have also tried deleting the folder from the Phasor step and remaking it. Tried cleaning the project and "Maven/update project..."

1

There are 1 answers

0
justcarlux On

That's basically the build cache. Try deleting all files from the "/target" or "/build" folder and try building again. This worked for me, but I use IntelliJ IDEA, still with Maven anyways.