Ron Majumdar
Ron Majumdar

Reputation: 1

Building Maven file for deployment to Tomcat with all pom.xml dependencies and other local libraries

can someone here help me with a maven build for deployment to Tomcat server. Would like to add jars (or ideally build the jar from a separate eclipse project) and of course, all dependent libraries on the pom.xml

[INFO] [1m------------------------------------------------------------------------[m [INFO] [1;31mBUILD FAILURE[m [INFO] [1m------------------------------------------------------------------------[m [INFO] Total time: 0.865 s [INFO] Finished at: 2025-02-22T11:28:18-06:00 [INFO] [1m------------------------------------------------------------------------[m [ERROR] Failed to execute goal [32morg.apache.maven.plugins:maven-compiler-plugin:3.12.1:compile[m [1m(default-compile)[m on project [36morg.ccode.pattern.rest[m: [1;31mCompilation failure[m: Compilation failure: [ERROR] /D:/assets/dev/github/ccode/ccode-process/api/Java/rest/src/main/java/org/ccode/asset/rest/admin/Organization.java:[10,23] cannot find symbol [ERROR] symbol: class JSONHandler [ERROR] location: package org.ccode.asset [ERROR] /D:/assets/dev/github/ccode/ccode-process/api/Java/rest/src/main/java/org/ccode/asset/rest/admin/Organization.java:[11,30] package org.ccode.asset.plugin does not exist [ERROR] -> [1m[Help 1][m [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the [1m-e[m switch. [ERROR] Re-run Maven using the [1m-X[m switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [1m[Help 1][m http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

---------------- ANSWER

Solution after lot of trial and error: Build my library project: mvn clean package install Add the library to the pom.xml for the WAR build: mvn clean package Use 2 pluins:org.apache.maven.pluginsmaven-compiler-plugin3.13.01717 maven-war-plugin3.4.0webfalse have the pom installed as well for the lib dependencies deploy WAR file (WEB-INF/lib) will contain all the jars to run the WAR build one needs to add all the jars and dependent jars to the class path, else does not compile Java 23 not supported, 22 does not work, 17 works

Upvotes: -1

Views: 28

Answers (0)

Related Questions