Maven packaging lacks one homegrown artifact from the same pom-tree

I have build a Maven-project-tree consisting of a top pom-project (named MyElectricity) and two subsequent jar-projects.

The project is meant to grow, so I split it to one (named MyElectricity-Common) holding the common classes and bindings (created with jaxb/jakarta) and one holding the logic (named MyElectricity-aWattar). It is meant to run as a standalone-jar, so alle needed artifacts/modules have to become packaged to a single jar, when installing the “MyElectricity-aWattar”.

The project has several dependencies. Some self created artifacts and several others from public sources (e.g. SpringBoot, MyBatis etc). As far as I can see all of them are resolved and packed to the jar created by the install-process. All – but “MyElectricity-aWattar”.
And I do not see why this one is missing.

Any guess or help is appreciated!

The top project is defined by this pom:

  <groupId>de.gombers.electricity</groupId>
  <artifactId>MyElectricity</artifactId>
  <packaging>pom</packaging>
  <properties>
    <revision>1.0.0</revision>
  </properties>

  <parent>
    <groupId>de.gombers.myhome</groupId>
    <artifactId>MyHome</artifactId>
    <version>1.0.0</version>
  </parent>

  <modules>
    <module>MyElectricity-aWattar</module>
    <module>MyElectricity-Common</module>
  </modules>

The “MyElectricity-Common” definitions are defined by this pom:

<artifactId>MyElectricity-Common</artifactId>

<parent>
    <groupId>de.gombers.electricity</groupId>
    <artifactId>MyElectricity</artifactId>
    <version>1.0.0</version>
</parent>
<build>
    <finalName>Common</finalName>
    <plugins>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>jaxb2-maven-plugin</artifactId>
            <version>3.1.0</version>
            <executions>
                <execution>
                    <id>xjc</id>
                    <goals>
                        <goal>xjc</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <clearOutputDir>true</clearOutputDir>
                <extension>true</extension>
                <sources>
                    <!-- only xsd files under here -->
                    <source>src/main/xsd</source>
                </sources>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>org.glassfish.jaxb</groupId>
                    <artifactId>jaxb-xjc</artifactId>
                    <version>${version.maven.org.glassfish.jaxb}</version>
                </dependency>
                <dependency>
                    <groupId>jakarta.activation</groupId>
                    <artifactId>jakarta.activation-api</artifactId>
                    <version>${version.maven.jakarta.activation.api}</version>
                </dependency>
                <dependency>
                    <groupId>jakarta.xml.bind</groupId>
                    <artifactId>jakarta.xml.bind-api</artifactId>
                    <version>${version.maven.jakarta.xml.bind-api}</version>
                </dependency>
                <dependency>
                    <groupId>com.sun.xml.bind</groupId>
                    <artifactId>jaxb-impl</artifactId>
                    <version>${version.maven.jaxb-impl}</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>

The “MyElectricity-aWattar” definitions are defined by this pom:

<artifactId>MyElectricity-aWattar</artifactId>
    
<parent>
    <groupId>de.gombers.electricity</groupId>
    <artifactId>MyElectricity</artifactId>
     <version>1.0.0</version>
</parent>

<build>
    <finalName>aWattar</finalName>
    
    <plugins>
        <plugin>
            <inherited>true</inherited>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>${java.version}</source>
                <target>${java.version}</target>
                <encoding>UTF-8</encoding>
                <showWarnings>true</showWarnings>
                <showDeprecation>true</showDeprecation>
            </configuration>
        </plugin>
        
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <configuration>
                <mainClass>de.gombers.electricity.awattar.MainDataGatherer</mainClass>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>repackage</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        
    </plugins>
</build>
    

<dependencies>
    <dependency>
        <groupId>de.gombers.electricity</groupId>
        <artifactId>MyElectricity-Common</artifactId>
        <version>${revision}</version>
    </dependency>
</dependencies>



Java-Version: is 17 
IDE: is Eclipse of 2024-09 
Maven: Apache Maven 3.9.9

3

The problem was:

  1. As already said in my comments, I made a mistake, when telling, the “MyElectricity-Common” was not included to the package of “MyElectricity-aWattar“. I had searched at the wrong place in the list of modules in the /lib. I had not realized the different sort order due to the uppercase name od the artifact. But I still do not understand why Eclipse did the install, while maven didn’t – and Maven is correct.

  2. The “MyElectricity-Common“-install did not put the generated classes to the root of the created JAR. So they could not be found and running the programs failed with missing classes. I solved this with adding the term
    <spring-boot.repackage.skip>true</spring-boot.repackage.skip> to the properties.
    This avoids failing the repackaging, which does not work for modules without main-classes

see also Execution Repackaging: Unable to repackage goal : main class not found

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật