quick-perf / quickperf

QuickPerf is a testing library for Java to quickly evaluate and improve some performance-related properties
https://github.com/quick-perf/doc/wiki/QuickPerf
Apache License 2.0
469 stars 67 forks source link

Could org.quickperf:quick-perf-sql-hibernate-test-util:1.0.2-SNAPSHOT drop off redundant dependencies to loose weight? #158

Closed Celebrate-future closed 3 years ago

Celebrate-future commented 3 years ago

@jeanbisutti Hi, I am a user of project org.quickperf:quick-perf-sql-hibernate-test-util:1.0.2-SNAPSHOT. I found that its pom file introduced 21 dependencies. However, among them, 17 libraries (80%) have not been used by your project (the redundant dependencies are listed below). Reduce these useless dependencies can help prevent conflicts between library versions. MeanWhile, it can minimize the total added size to projects. It can also help enable advanced scenarios for users of your package. This PR helps org.quickperf:quick-perf-sql-hibernate-test-util:1.0.2-SNAPSHOT lose weight :) I have tested the revised configuration in my local environment. It is safe to remove the unused libraries.

Best regards

Redundant dependencies----


org.jboss:jandex:jar:2.0.5.Final:compile
org.glassfish.jaxb:jaxb-runtime:jar:2.3.1:compile
org.hibernate.common:hibernate-commons-annotations:jar:5.1.0.Final:compile
org.hibernate:hibernate-core:jar:5.4.0.Final:compile
com.sun.istack:istack-commons-runtime:jar:3.0.7:compile
org.jboss.logging:jboss-logging:jar:3.3.2.Final:compile
javax.xml.bind:jaxb-api:jar:2.3.1:compile
org.glassfish.jaxb:txw2:jar:2.3.1:compile
com.sun.xml.fastinfoset:FastInfoset:jar:1.2.15:compile
javax.activation:javax.activation-api:jar:1.2.0:compile
org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.1.1.Final:compile
org.jvnet.staxex:stax-ex:jar:1.8:compile
antlr:antlr:jar:2.7.7:compile
org.javassist:javassist:jar:3.24.0-GA:compile
net.bytebuddy:byte-buddy:jar:1.9.5:compile
com.fasterxml:classmate:jar:1.3.4:compile
org.dom4j:dom4j:jar:2.1.1:compile
jeanbisutti commented 3 years ago

@Celebrate-future Thank you very much for this PR!

I noticed that the CI is failing:

Error:  Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (default-testCompile) on project quick-perf-sql-memory-test: Compilation failure: Compilation failure: 
Error:  /home/runner/work/quickperf/quickperf/sql/sql-memory-test/src/test/java/SqlTestBase.java:[13,30] package org.hibernate.internal does not exist
Error:  /home/runner/work/quickperf/quickperf/sql/sql-memory-test/src/test/java/SqlTestBase.java:[14,25] package org.hibernate.jpa does not exist
Error:  /home/runner/work/quickperf/quickperf/sql/sql-memory-test/src/test/java/SqlTestBase.java:[41,55] cannot find symbol
Error:    symbol:   class HibernatePersistenceProvider
Error:    location: class SqlTestBase
Error:  /home/runner/work/quickperf/quickperf/sql/sql-memory-test/src/test/java/SqlTestBase.java:[70,9] cannot find symbol
Error:    symbol:   class SessionImpl
Error:    location: class SqlTestBase
Error:  /home/runner/work/quickperf/quickperf/sql/sql-memory-test/src/test/java/SqlTestBase.java:[70,32] cannot find symbol
Error:    symbol:   class SessionImpl
Error:    location: class SqlTestBase

When org.hibernate:hibernate-core is not excluded from quick-perf-sql-hibernate-test-util, the compilation works fine. However, several tests belonging to sql-memory-test Maven module fail:

java.lang.NoClassDefFoundError: Could not initialize class org.hibernate.jpa.HibernatePersistenceProvider

FYI quick-perf-sql-hibernate-test-util is an internal library helping to write non-regression tests on QuickPerf SQL annotations. It is not released on Maven central. So, dependency optimization of quick-perf-sql-hibernate-test-util is not an issue for QuickPerf users. In addition, even if the build was ok, it would introduce some code complexity without adding an improvement for the QuickPerf users. So, I am going to close this issue. Thanks for the time you spent working on this. You will be welcome if you would like to suggest other improvements.

Best regards,

Jean