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

MyBatis 3.0.4 packaging is broken #1037

Open
michael-simons opened this issue Dec 3, 2024 · 1 comment
Open

MyBatis 3.0.4 packaging is broken #1037

michael-simons opened this issue Dec 3, 2024 · 1 comment

Comments

@michael-simons
Copy link

A starter module *-spring-boot-starter itself shall not contain any classes but depend on the corresponding *-spring-boot-autoconfigure module.

Up to 3.0.3 this was fine in Mybatis, but in 3.0.4 the starter modules contains the same classes as the auto configure module, which is going to be a hard to spot problem for some.

See

unzip -l ~/.m2/repository/org/mybatis/spring/boot/mybatis-spring-boot-starter/3.0.4/mybatis-spring-boot-starter-3.0.4.jar
Archive:  /Users/msimons/.m2/repository/org/mybatis/spring/boot/mybatis-spring-boot-starter/3.0.4/mybatis-spring-boot-starter-3.0.4.jar
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  11-27-2024 15:06   META-INF/
     2865  11-27-2024 15:06   META-INF/MANIFEST.MF
        0  11-27-2024 15:06   org/
        0  11-27-2024 15:06   org/mybatis/
        0  11-27-2024 15:06   org/mybatis/spring/
        0  11-27-2024 15:06   org/mybatis/spring/boot/
        0  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/
        0  11-27-2024 15:06   org/mybatis/spring/boot/starter/
        0  11-27-2024 15:06   META-INF/maven/
        0  11-27-2024 15:06   META-INF/maven/org.mybatis.spring.boot/
        0  11-27-2024 15:06   META-INF/maven/org.mybatis.spring.boot/mybatis-spring-boot-starter/
      352  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/ConfigurationCustomizer.class
     7546  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration$AutoConfiguredMapperScannerRegistrar.class
     1649  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration$MapperScannerRegistrarNotFoundConfiguration.class
    12568  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class
      846  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisDependsOnDatabaseInitializationDetector.class
     1928  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisLanguageDriverAutoConfiguration$FreeMarkerConfiguration.class
     1441  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisLanguageDriverAutoConfiguration$LegacyFreeMarkerConfiguration.class
     1369  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisLanguageDriverAutoConfiguration$LegacyVelocityConfiguration.class
     1986  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisLanguageDriverAutoConfiguration$ThymeleafConfiguration$MetadataThymeleafLanguageDriverConfig.class
     2094  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisLanguageDriverAutoConfiguration$ThymeleafConfiguration.class
     1884  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisLanguageDriverAutoConfiguration$VelocityConfiguration.class
     1766  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisLanguageDriverAutoConfiguration.class
    14159  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisProperties$CoreConfiguration.class
     6399  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisProperties.class
     5237  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/SpringBootVFS.class
      367  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/SqlSessionFactoryBeanCustomizer.class
      143  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/package-info.class
      137  11-27-2024 15:06   org/mybatis/spring/boot/starter/package-info.class
     2111  11-27-2024 15:06   META-INF/maven/org.mybatis.spring.boot/mybatis-spring-boot-starter/pom.xml
       85  11-27-2024 15:06   META-INF/maven/org.mybatis.spring.boot/mybatis-spring-boot-starter/pom.properties
---------                     -------
    66932                     31 files

and

unzip -l ~/.m2/repository/org/mybatis/spring/boot/mybatis-spring-boot-autoconfigure/3.0.4/mybatis-spring-boot-autoconfigure-3.0.4.jar 
Archive:  /Users/msimons/.m2/repository/org/mybatis/spring/boot/mybatis-spring-boot-autoconfigure/3.0.4/mybatis-spring-boot-autoconfigure-3.0.4.jar
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  11-27-2024 15:06   META-INF/
     2928  11-27-2024 15:06   META-INF/MANIFEST.MF
        0  11-27-2024 15:06   META-INF/spring/
        0  11-27-2024 15:06   org/
        0  11-27-2024 15:06   org/mybatis/
        0  11-27-2024 15:06   org/mybatis/spring/
        0  11-27-2024 15:06   org/mybatis/spring/boot/
        0  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/
        0  11-27-2024 15:06   META-INF/maven/
        0  11-27-2024 15:06   META-INF/maven/org.mybatis.spring.boot/
        0  11-27-2024 15:06   META-INF/maven/org.mybatis.spring.boot/mybatis-spring-boot-autoconfigure/
     1206  11-27-2024 15:06   META-INF/additional-spring-configuration-metadata.json
      140  11-27-2024 15:06   META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
     2304  11-27-2024 15:06   META-INF/spring-autoconfigure-metadata.properties
    28011  11-27-2024 15:06   META-INF/spring-configuration-metadata.json
      854  11-27-2024 15:06   META-INF/spring.factories
      352  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/ConfigurationCustomizer.class
     7546  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration$AutoConfiguredMapperScannerRegistrar.class
     1649  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration$MapperScannerRegistrarNotFoundConfiguration.class
    12568  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class
      846  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisDependsOnDatabaseInitializationDetector.class
     1928  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisLanguageDriverAutoConfiguration$FreeMarkerConfiguration.class
     1441  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisLanguageDriverAutoConfiguration$LegacyFreeMarkerConfiguration.class
     1369  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisLanguageDriverAutoConfiguration$LegacyVelocityConfiguration.class
     1986  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisLanguageDriverAutoConfiguration$ThymeleafConfiguration$MetadataThymeleafLanguageDriverConfig.class
     2094  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisLanguageDriverAutoConfiguration$ThymeleafConfiguration.class
     1884  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisLanguageDriverAutoConfiguration$VelocityConfiguration.class
     1766  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisLanguageDriverAutoConfiguration.class
    14159  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisProperties$CoreConfiguration.class
     6399  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/MybatisProperties.class
     5237  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/SpringBootVFS.class
      367  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/SqlSessionFactoryBeanCustomizer.class
      143  11-27-2024 15:06   org/mybatis/spring/boot/autoconfigure/package-info.class
     3978  11-27-2024 15:06   META-INF/maven/org.mybatis.spring.boot/mybatis-spring-boot-autoconfigure/pom.xml
       91  11-27-2024 15:06   META-INF/maven/org.mybatis.spring.boot/mybatis-spring-boot-autoconfigure/pom.properties
---------                     -------
   101246                     35 files

I noticed that on a dependency upgrade: neo4j/neo4j-jdbc#799

and the failing test here https://github.com/neo4j/neo4j-jdbc/actions/runs/12113564576/job/33768792949?pr=799#step:7:756 (Using duplicate-finder-maven-plugin to avoid such issues)

@harawata
Copy link
Member

harawata commented Dec 5, 2024

Hello @michael-simons ,

Thank you for letting us know.
I did some tests and the behavior changed in parent 41, it seems.

@hazendaz may be able to fix it, but he is quite busy, so if someone knows how to fix this, please send us a PR.

p.s.
This also was the cause of the Sonatype rule violation that was fixed by #1034 , probably.

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