0

I have created a jhipster project. after making some changes in the java code i am not able to run "mvn clean install" command. I had created a Mapstruct mapper class for an API. That is the only change i have done. the log is given below.

[[1;34mINFO[m] [1;31mBUILD FAILURE[m
[[1;34mINFO[m] [1m------------------------------------------------------------------------[m
[[1;34mINFO[m] Total time:  02:20 min
[[1;34mINFO[m] Finished at: 2023-07-19T20:28:55+05:30
[[1;34mINFO[m] [1m------------------------------------------------------------------------[m
[[1;31mERROR[m] Failed to execute goal [32morg.gaul:modernizer-maven-plugin:2.4.0:modernizer[m [1m(modernizer)[m on project [36mbuyyinn[m: [1;31mExecution modernizer of goal org.gaul:modernizer-maven-plugin:2.4.0:modernizer failed: A required class was missing while executing org.gaul:modernizer-maven-plugin:2.4.0:modernizer: org/codehaus/plexus/util/StringUtils[m
[[1;31mERROR[m] [1;31m-----------------------------------------------------[m
[[1;31mERROR[m] [1;31mrealm =    plugin>org.gaul:modernizer-maven-plugin:2.4.0[m
[[1;31mERROR[m] [1;31mstrategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy[m
[[1;31mERROR[m] [1;31murls[0] = file:/C:/Users/sanal/.m2/repository/org/gaul/modernizer-maven-plugin/2.4.0/modernizer-maven-plugin-2.4.0.jar[m
[[1;31mERROR[m] [1;31murls[1] = file:/C:/Users/sanal/.m2/repository/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar[m
[[1;31mERROR[m] [1;31murls[2] = file:/C:/Users/sanal/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.11/plexus-interpolation-1.11.jar[m
[[1;31mERROR[m] [1;31murls[3] = file:/C:/Users/sanal/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar[m
[[1;31mERROR[m] [1;31murls[4] = file:/C:/Users/sanal/.m2/repository/org/ow2/asm/asm/9.2/asm-9.2.jar[m
[[1;31mERROR[m] [1;31murls[5] = file:/C:/Users/sanal/.m2/repository/org/ow2/asm/asm-commons/9.2/asm-commons-9.2.jar[m
[[1;31mERROR[m] [1;31murls[6] = file:/C:/Users/sanal/.m2/repository/org/ow2/asm/asm-tree/9.2/asm-tree-9.2.jar[m
[[1;31mERROR[m] [1;31murls[7] = file:/C:/Users/sanal/.m2/repository/org/ow2/asm/asm-analysis/9.2/asm-analysis-9.2.jar[m
[[1;31mERROR[m] [1;31murls[8] = file:/C:/Users/sanal/.m2/repository/org/gaul/modernizer-maven-annotations/2.4.0/modernizer-maven-annotations-2.4.0.jar[m
[[1;31mERROR[m] [1;31mNumber of foreign imports: 1[m
[[1;31mERROR[m] [1;31mimport: Entry[import  from realm ClassRealm[maven.api, parent: null]][m
[[1;31mERROR[m] [1;31m[m
[[1;31mERROR[m] [1;31m-----------------------------------------------------[m
[[1;31mERROR[m] [1;31m[m: org.codehaus.plexus.util.StringUtils
[[1;31mERROR[m] -> [1m[Help 1]

The Jhipster version i am using is 7.9.3

I am not abell to understand this issue. Can anyone help?

Sanal M
  • 187
  • 4
  • 17
  • Could you try upgrading your Modernizer plugin to 2.6.0. They removed the usage of Plexus StringUtils to be compatible with newer versions of Maven. this may be the cause of your problem. – M. Rizzo Jul 19 '23 at 15:29
  • It worked. Thanks. If you can post this comment as an answer we can mark it. – Sanal M Jul 30 '23 at 06:50
  • It's safer to use the maven wrapper (`mvnw`) configured by JHipster rather than your globally installed maven (`mvn`). This way you ensure that you are using a compatible version that has passed JHipster team CI tests. – Gaël Marziou Jul 31 '23 at 22:27

1 Answers1

2

I believe if upgrade your Modernizer plugin to 2.6.0, it should address your issue. They removed the usage of Plexus StringUtils to be compatible with newer versions of Maven. this may be the cause of your problem.

M. Rizzo
  • 1,611
  • 12
  • 24