Eclipse Maven Project could not resolve dependencies - java

This is my first question in this field, because I have not worked with Eclipse and Maven. So, be indulgent! I have been searching for solution for weeks with no luck, so I hope it is not a duplicate.
I'm trying to build a Maven project in Eclipse. The project is checked out from a Subversion repository. It has custom pom.xml files and they contain several dependencies from VPN remote repository. I have a local folder with jars and all the necessary files. If a remote file is unavailable or not exists, it should load from the local folder. I am really sure all the dependency declarations are correct and the maven settings specifies the correct path to the folder. The folder name start with a "." and the macOS handles these files as hidden (I don't think this is the problem), because Maven finds some of the files in the directory, except the milyn/flute/1.3/flute-1.3.pom. I hope everything is clear.
Sorry for the long post.
The console log tells the story much better:
[INFO] Scanning for projects...
[INFO] ----------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] CTA main project
[INFO] cta-bom
[INFO] cta-common
[INFO] cta-model
[INFO] cta-birt
[INFO] cta-dto
[INFO] cta-business
[INFO] cta-web
[INFO] cta-test
[INFO]
[INFO] ----------------------------------------------------------------
[INFO] Building CTA main project 1.0.10-SNAPSHOT
[INFO] ----------------------------------------------------------------
[INFO] --- properties-maven-plugin:1.0-alpha-2:read-project-properties (clean-properties) # cta ---
[WARNING] Ignoring missing properties file: /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/developer.properties
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # cta ---
[INFO]
[INFO] --- properties-maven-plugin:1.0-alpha-2:read-project-properties (build-properties) # cta ---
[WARNING] Ignoring missing properties file: /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/developer.properties
[INFO]
[INFO] --- buildnumber-maven-plugin:1.3:create (default) # cta ---
[INFO] Executing: /bin/sh -c cd "/Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta" && svn --non-interactive info
[INFO] Working directory: /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta
[INFO] Storing buildNumber: 1702 at timestamp: 1477050870632
[INFO] Executing: /bin/sh -c cd "/Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta" && svn --non-interactive info
[INFO] Working directory: /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta
[INFO] Storing buildScmBranch: trunk
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # cta ---
[INFO] Installing /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/pom.xml to /Users/tothkristof/.m2/repository/hu/innovitech/cta/cta/1.0.10-SNAPSHOT/cta-1.0.10-SNAPSHOT.pom
[INFO]
[INFO] ----------------------------------------------------------------
[INFO] Building cta-bom 1.0.10-SNAPSHOT
[INFO] ----------------------------------------------------------------
[INFO]
[INFO] --- properties-maven-plugin:1.0-alpha-2:read-project-properties (clean-properties) # cta-bom ---
[WARNING] Ignoring missing properties file: /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-bom/developer.properties
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # cta-bom ---
[INFO]
[INFO] --- properties-maven-plugin:1.0-alpha-2:read-project-properties (build-properties) # cta-bom ---
[WARNING] Ignoring missing properties file: /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-bom/developer.properties
[INFO]
[INFO] --- buildnumber-maven-plugin:1.3:create (default) # cta-bom ---
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # cta-bom ---
[INFO] Installing /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-bom/pom.xml to /Users/tothkristof/.m2/repository/hu/innovitech/cta/cta-bom/1.0.10-SNAPSHOT/cta-bom-1.0.10-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building cta-common 1.0.10-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- properties-maven-plugin:1.0-alpha-2:read-project-properties (clean-properties) # cta-common ---
[WARNING] Ignoring missing properties file: /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-common/developer.properties
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # cta-common ---
[INFO]
[INFO] --- properties-maven-plugin:1.0-alpha-2:read-project-properties (build-properties) # cta-common ---
[WARNING] Ignoring missing properties file: /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-common/developer.properties
[INFO]
[INFO] --- buildnumber-maven-plugin:1.3:create (default) # cta-common ---
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) # cta-common ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-common/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) # cta-common ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 4 source files to /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-common/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) # cta-common ---
[INFO] Not copying test resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) # cta-common ---
[INFO] Not compiling test sources
[INFO]
[INFO] --- maven-surefire-plugin:2.4.3:test (default-test) # cta-common ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:2.6:jar (default-jar) # cta-common ---
[INFO] Building jar: /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-common/target/cta-common-1.0.10-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # cta-common ---
[INFO] Installing /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-common/target/cta-common-1.0.10-SNAPSHOT.jar to /Users/tothkristof/.m2/repository/hu/innovitech/cta/cta-common/1.0.10-SNAPSHOT/cta-common-1.0.10-SNAPSHOT.jar
[INFO] Installing /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-common/pom.xml to /Users/tothkristof/.m2/repository/hu/innovitech/cta/cta-common/1.0.10-SNAPSHOT/cta-common-1.0.10-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building cta-model 1.0.10-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- properties-maven-plugin:1.0-alpha-2:read-project-properties (clean-properties) # cta-model ---
[WARNING] Ignoring missing properties file: /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-model/developer.properties
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # cta-model ---
[INFO]
[INFO] --- properties-maven-plugin:1.0-alpha-2:read-project-properties (build-properties) # cta-model ---
[WARNING] Ignoring missing properties file: /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-model/developer.properties
[INFO]
[INFO] --- buildnumber-maven-plugin:1.3:create (default) # cta-model ---
[INFO]
[INFO] --- maven-resources-plugin:2.7:resources (default-resources) # cta-model ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 5 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) # cta-model ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 46 source files to /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-model/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.7:testResources (default-testResources) # cta-model ---
[INFO] Not copying test resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) # cta-model ---
[INFO] Not compiling test sources
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # cta-model ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:2.6:jar (default-jar) # cta-model ---
[INFO] Building jar: /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-model/target/cta-model-1.0.10-SNAPSHOT.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # cta-model ---
[INFO] Installing /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-model/target/cta-model-1.0.10-SNAPSHOT.jar to /Users/tothkristof/.m2/repository/hu/innovitech/cta/cta-model/1.0.10-SNAPSHOT/cta-model-1.0.10-SNAPSHOT.jar
[INFO] Installing /Users/tothkristof/Documents/Programming/Java Projects/CTA Project/cta/cta-model/pom.xml to /Users/tothkristof/.m2/repository/hu/innovitech/cta/cta-model/1.0.10-SNAPSHOT/cta-model-1.0.10-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building cta-birt 1.0.10-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] Downloading: https://maven.innovitech.internal/nexus/content/groups/public/milyn/flute/1.3/flute-1.3.pom
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] CTA main project ................................... SUCCESS [ 1.250 s]
[INFO] cta-bom ............................................ SUCCESS [ 0.016 s]
[INFO] cta-common ......................................... SUCCESS [ 2.854 s]
[INFO] cta-model .......................................... SUCCESS [ 1.733 s]
[INFO] cta-birt ........................................... FAILURE [ 6.206 s]
[INFO] cta-dto ............................................ SKIPPED
[INFO] cta-business ....................................... SKIPPED
[INFO] cta-web ............................................ SKIPPED
[INFO] cta-test ........................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 12.792 s
[INFO] Finished at: 2016-10-21T13:54:41+02:00
[INFO] Final Memory: 35M/365M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project cta-birt: Could not resolve dependencies for project hu.innovitech.cta:cta-birt:jar:1.0.10-SNAPSHOT: Failed to collect dependencies at hu.ss.weld:weld-fw-birt:jar:1.0.3 -> org.eclipse.birt.runtime:org.eclipse.birt.runtime:jar:4.3.0 -> milyn:flute:jar:1.3: Failed to read artifact descriptor for milyn:flute:jar:1.3: Could not transfer artifact milyn:flute:pom:1.3 from/to innovitech-repository (https://maven.innovitech.internal/nexus/content/groups/public): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :cta-birt
If you need more information files or path, I can add them.
Thanks in advance,
Kristof

As you are downloading on an HTTPS site, you need to add the server certificate in your trust store.
Then, when you run your maven command, don't forget to add the environment properties for this trust store.
Here is a link on how to create the truststore :
Digital Certificate: How to import .cer file in to .truststore file using?
And :
-Djavax.net.ssl.trustStore=/home/path/to/truststore
To use the truststore when running your compilation.
You can also follow this guide from Maven :
http://maven.apache.org/guides/mini/guide-repository-ssl.html

Related

Spring boot application deployed on heroky returns empty response (no headers, no data)

I have created a simple Spring boot app and deployed to Heroku. It builds and runs normally, and no errors are displayed in the logs, but when i try to access the application on insomnia, it gives me the following error description: Error: Server returned nothing (no headers, no data).
The application works perfectly when running on localhost.
Here is my Procfile:
web: java -Dserver.port=$PORT -Dspring.profiles.active=prod $JAVA_OPTS -jar target/seniorerp-0.0.1-SNAPSHOT.jar
Heroku build log:
-----> Using buildpack: heroku/java
-----> Java app detected
-----> Installing OpenJDK 11... done
-----> Executing Maven
$ ./mvnw -DskipTests clean dependency:list install
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< thiago.piffer:seniorerp >-----------------------
[INFO] Building seniorerp 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.2.0:clean (default-clean) # seniorerp ---
[INFO]
[INFO] --- maven-dependency-plugin:3.3.0:list (default-cli) # seniorerp ---
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) # seniorerp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.10.1:compile (default-compile) # seniorerp ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 25 source files to /tmp/build_321f1d66/target/classes
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) # seniorerp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /tmp/build_321f1d66/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.10.1:testCompile (default-testCompile) # seniorerp ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 8 source files to /tmp/build_321f1d66/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) # seniorerp ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:3.2.2:jar (default-jar) # seniorerp ---
[INFO] Building jar: /tmp/build_321f1d66/target/seniorerp-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.7.2:repackage (repackage) # seniorerp ---
[INFO] Replacing main artifact with repackaged archive
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) # seniorerp ---
[INFO] Installing /tmp/build_321f1d66/target/seniorerp-0.0.1-SNAPSHOT.jar to /tmp/codon/tmp/cache/.m2/repository/thiago/piffer/seniorerp/0.0.1-SNAPSHOT/seniorerp-0.0.1-SNAPSHOT.jar
[INFO] Installing /tmp/build_321f1d66/pom.xml to /tmp/codon/tmp/cache/.m2/repository/thiago/piffer/seniorerp/0.0.1-SNAPSHOT/seniorerp-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.955 s
[INFO] Finished at: 2022-08-24T14:10:10Z
[INFO] ------------------------------------------------------------------------
-----> Discovering process types
Procfile declares types -> web
-----> Compressing...
Done: 96.8M
-----> Launching...
Released v20
https://senior-erp-desafio-tecnico.herokuapp.com/ deployed to Heroku

Jenkins is unable to find the java file in workspace

We are following the instructions given by some tutorials to integrate our project with jenkins unsuccessfully, we think the reason is the path to the scripts of java. Could you give us a hand? The log result is:
Started by user admin
Running as SYSTEM Building in workspace C:\Users\xxxxxxx\.jenkins\workspace\JenkinsDemo Parsing POMs Established TCP socket on 57342 [JenkinsDemo] $ "C:\Program Files\Java\jdk-11.0.11/bin/java" -cp C:\Users\xxxxxxx\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven35-agent-1.13.jar;C:\Users\xxxxxxx\apache-maven-3.8.1\boot\plexus-classworlds-2.6.0.jar;C:\Users\xxxxxxx\apache-maven-3.8.1/conf/logging jenkins.maven3.agent.Maven35Main C:\Users\xxxxxxx\apache-maven-3.8.1 C:\Users\xxxxxxx\.jenkins\war\WEB-INF\lib\remoting-4.12.jar C:\Users\xxxxxxx\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven35-interceptor-1.13.jar C:\Users\xxxxxxx\.jenkins\plugins\maven-plugin\WEB-INF\lib\maven3-interceptor-commons-1.13.jar 57342 <===[JENKINS REMOTING CAPACITY]===>channel started Executing Maven: -B -f C:\Users\xxxxxxx\.jenkins\workspace\JenkinsDemo\pom.xml install [INFO] Scanning for projects... [INFO] [INFO]
----------------------< JenkinsDemo:JenkinsDemo >----------------------- [INFO] Building JenkinsDemo 0.0.1-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) # JenkinsDemo
--- [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory C:\Users\xxxxxxx\.jenkins\workspace\JenkinsDemo\src\main\resources [INFO] [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # JenkinsDemo --- [INFO] Nothing to compile - all classes are up to date [INFO] [INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # JenkinsDemo --- [WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! [INFO] skip non existing resourceDirectory C:\Users\xxxxxxx\.jenkins\workspace\JenkinsDemo\src\test\resources [INFO] [INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) # JenkinsDemo --- [INFO] No sources to compile [INFO] [INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # JenkinsDemo --- [INFO] No tests to run. [JENKINS] Guardando informes de test [INFO] [INFO] --- maven-jar-plugin:2.4:jar (default-jar) # JenkinsDemo --- [INFO] [INFO] --- maven-install-plugin:2.4:install (default-install) # JenkinsDemo --- [INFO] Installing C:\Users\xxxxxxx\.jenkins\workspace\JenkinsDemo\target\JenkinsDemo-0.0.1-SNAPSHOT.jar to C:\Users\xxxxxxx\.m2\repository\JenkinsDemo\JenkinsDemo\0.0.1-SNAPSHOT\JenkinsDemo-0.0.1-SNAPSHOT.jar [INFO] Installing C:\Users\xxxxxxx\.jenkins\workspace\JenkinsDemo\pom.xml to C:\Users\xxxxxxx\.m2\repository\JenkinsDemo\JenkinsDemo\0.0.1-SNAPSHOT\JenkinsDemo-0.0.1-SNAPSHOT.pom [INFO]
------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO]
------------------------------------------------------------------------ [INFO] Total time: 3.337 s [INFO] Finished at: 2022-05-09T12:20:50+02:00 [INFO]
------------------------------------------------------------------------ Esperando a que Jenkins finalice de recopilar datos [JENKINS] Archiving C:\Users\xxxxxxx\.jenkins\workspace\JenkinsDemo\pom.xml to JenkinsDemo/JenkinsDemo/0.0.1-SNAPSHOT/JenkinsDemo-0.0.1-SNAPSHOT.pom [JENKINS] Archiving C:\Users\xxxxxxx\.jenkins\workspace\JenkinsDemo\target\JenkinsDemo-0.0.1-SNAPSHOT.jar to JenkinsDemo/JenkinsDemo/0.0.1-SNAPSHOT/JenkinsDemo-0.0.1-SNAPSHOT.jar channel stopped [JenkinsDemo] $ cmd /c call C:\Users\xxxxxxx\AppData\Local\Temp\jenkins13221465416928573076.bat
C:\Users\xxxxxxx\.jenkins\workspace\JenkinsDemo>javac EnviarPruebaDeIngles.java error: file not found: EnviarPruebaDeIngles.java Usage: javac <options> <source files> use
--help for a list of possible options
C:\Users\xxxxxxx\.jenkins\workspace\JenkinsDemo>java EnviarPruebaDeIngles Error: Could not find or load main class EnviarPruebaDeIngles Caused by: java.lang.ClassNotFoundException: EnviarPruebaDeIngles
C:\Users\xxxxxxx\.jenkins\workspace\JenkinsDemo>exit 1 Build step 'Execute Windows batch command' marked build as failure Finished: FAILURE
Project configuration is:
Our eclipse with selenium project tree, our intention is to execute like the main classes which are going to be located at com.jenkins.demo

Maven must compile before install (package) in mutil module maven project

I have a Spring boot maven project (mutil-module) like this:
-parent
|
|-child1
| |-src
| |-pom.xml
|
|-child2
| |-src
| |-pom.xml
|
|-pom.xml
Problem:
I always must be run mvn compile before can run mvn package or mvn install.
If I run mvn clean install then build will failed
I guess: Something happen when install(package) ignore compile in lifecycle.
-- Trace error if package without compile first
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /F:/Workspace/Chinese-Chess-World/Public-Repo/Chinese-Chess-World/Chinese-Chess-World/ccw-game-service-contract/src/main/java/com/doubleat/ccw/usermanagement/CcwGameServiceContractApplication.java:[3,40] package com.doubleat
.ccw.common.constant does not exist
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for ccw-platform 1.0:
[INFO]
[INFO] ccw-platform ....................................... SUCCESS [ 0.479 s]
[INFO] ccw-common ......................................... SUCCESS [ 2.070 s]
[INFO] ccw-config-service ................................. SUCCESS [ 0.585 s]
[INFO] ccw-game-service-contract .......................... FAILURE [ 0.666 s]
[INFO] ccw-game-service ................................... SKIPPED
[INFO] ccw-user-management-service-contract ............... SKIPPED
[INFO] ccw-user-management-service ........................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.110 s
[INFO] Finished at: 2021-02-27T19:21:18+07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project ccw-game-service-contract: Compilation failure
[ERROR] /F:/Workspace/Chinese-Chess-World/Public-Repo/Chinese-Chess-World/Chinese-Chess-World/ccw-game-service-contract/src/main/java/com/doubleat/ccw/usermanagement/CcwGameServiceContractApplication.java:[3,40] package com.doubleat
.ccw.common.constant does not exist
[ERROR]
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project ccw-game-service-contract: Compilation failure
/F:/Workspace/Chinese-Chess-World/Public-Repo/Chinese-Chess-World/Chinese-Chess-World/ccw-game-service-contract/src/main/java/com/doubleat/ccw/usermanagement/CcwGameServiceContractApplication.java:[3,40] package com.doubleat.ccw.com
mon.constant does not exist
-- Full details
F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World>mvn install
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.doubleat.ccw:ccw-common:jar:1.0
[WARNING] 'version' contains an expression but should be a constant. # com.doubleat.ccw:ccw-common:${ccw-common.version}, F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-common\pom.xml, line
14, column 14
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.doubleat.ccw:ccw-config-service:jar:1.0
[WARNING] 'version' contains an expression but should be a constant. # com.doubleat.ccw:ccw-config-service:${ccw-config-service.version}, F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-confi
g-service\pom.xml, line 14, column 14
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.doubleat.ccw:ccw-game-service-contract:jar:1.0
[WARNING] 'version' contains an expression but should be a constant. # com.doubleat.ccw:ccw-game-service-contract:${ccw-game-service-contract.version}, F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-W
orld\ccw-game-service-contract\pom.xml, line 14, column 14
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.doubleat.ccw:ccw-user-management-service:jar:1.0
[WARNING] 'version' contains an expression but should be a constant. # com.doubleat.ccw:ccw-user-management-service:${ccw-user-management-service.version}, F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Che
ss-World\ccw-user-management-service\pom.xml, line 14, column 14
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.doubleat.ccw:ccw-user-management-service-contract:jar:1.0
[WARNING] 'version' contains an expression but should be a constant. # com.doubleat.ccw:ccw-user-management-service-contract:${ccw-user-management-service-contract.version}, F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess
-World\Chinese-Chess-World\ccw-user-management-service-contract\pom.xml, line 14, column 14
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] ccw-platform [pom]
[INFO] ccw-common [jar]
[INFO] ccw-config-service [jar]
[INFO] ccw-game-service-contract [jar]
[INFO] ccw-game-service [jar]
[INFO] ccw-user-management-service-contract [jar]
[INFO] ccw-user-management-service [jar]
[INFO]
[INFO] -------------------< com.doubleat.ccw:ccw-platform >--------------------
[INFO] Building ccw-platform 1.0 [1/7]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- spring-boot-maven-plugin:2.4.3:repackage (repackage) # ccw-platform ---
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) # ccw-platform ---
[INFO] Installing F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\pom.xml to C:\Users\Admin\.m2\repository\com\doubleat\ccw\ccw-platform\1.0\ccw-platform-1.0.pom
[INFO]
[INFO] --------------------< com.doubleat.ccw:ccw-common >---------------------
[INFO] Building ccw-common 1.0 [2/7]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) # ccw-common ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # ccw-common ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-common\target\classes
Terminate batch job (Y/N)? y
F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World>mvn -e install -Dmaven.test.skip=true
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.doubleat.ccw:ccw-common:jar:1.0
[WARNING] 'version' contains an expression but should be a constant. # com.doubleat.ccw:ccw-common:${ccw-common.version}, F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-common\pom.xml, line
14, column 14
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.doubleat.ccw:ccw-config-service:jar:1.0
[WARNING] 'version' contains an expression but should be a constant. # com.doubleat.ccw:ccw-config-service:${ccw-config-service.version}, F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-confi
g-service\pom.xml, line 14, column 14
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.doubleat.ccw:ccw-game-service-contract:jar:1.0
[WARNING] 'version' contains an expression but should be a constant. # com.doubleat.ccw:ccw-game-service-contract:${ccw-game-service-contract.version}, F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-W
orld\ccw-game-service-contract\pom.xml, line 14, column 14
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.doubleat.ccw:ccw-user-management-service:jar:1.0
[WARNING] 'version' contains an expression but should be a constant. # com.doubleat.ccw:ccw-user-management-service:${ccw-user-management-service.version}, F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Che
ss-World\ccw-user-management-service\pom.xml, line 14, column 14
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.doubleat.ccw:ccw-user-management-service-contract:jar:1.0
[WARNING] 'version' contains an expression but should be a constant. # com.doubleat.ccw:ccw-user-management-service-contract:${ccw-user-management-service-contract.version}, F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess
-World\Chinese-Chess-World\ccw-user-management-service-contract\pom.xml, line 14, column 14
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] ccw-platform [pom]
[INFO] ccw-common [jar]
[INFO] ccw-config-service [jar]
[INFO] ccw-game-service-contract [jar]
[INFO] ccw-game-service [jar]
[INFO] ccw-user-management-service-contract [jar]
[INFO] ccw-user-management-service [jar]
[INFO]
[INFO] -------------------< com.doubleat.ccw:ccw-platform >--------------------
[INFO] Building ccw-platform 1.0 [1/7]
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- spring-boot-maven-plugin:2.4.3:repackage (repackage) # ccw-platform ---
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) # ccw-platform ---
[INFO] Installing F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\pom.xml to C:\Users\Admin\.m2\repository\com\doubleat\ccw\ccw-platform\1.0\ccw-platform-1.0.pom
[INFO]
[INFO] --------------------< com.doubleat.ccw:ccw-common >---------------------
[INFO] Building ccw-common 1.0 [2/7]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) # ccw-common ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # ccw-common ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-common\target\classes
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) # ccw-common ---
[INFO] Not copying test resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) # ccw-common ---
[INFO] Not compiling test sources
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) # ccw-common ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) # ccw-common ---
[INFO] Building jar: F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-common\target\ccw-common-1.0.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.4.3:repackage (repackage) # ccw-common ---
[INFO] Replacing main artifact with repackaged archive
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) # ccw-common ---
[INFO] Installing F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-common\target\ccw-common-1.0.jar to C:\Users\Admin\.m2\repository\com\doubleat\ccw\ccw-common\1.0\ccw-common-1.0.jar
[INFO] Installing F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-common\pom.xml to C:\Users\Admin\.m2\repository\com\doubleat\ccw\ccw-common\1.0\ccw-common-1.0.pom
[INFO]
[INFO] ----------------< com.doubleat.ccw:ccw-config-service >-----------------
[INFO] Building ccw-config-service 1.0 [3/7]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) # ccw-config-service ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 2 resources
[INFO] Copying 2 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # ccw-config-service ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-config-service\target\classes
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:testResources (default-testResources) # ccw-config-service ---
[INFO] Not copying test resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) # ccw-config-service ---
[INFO] Not compiling test sources
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) # ccw-config-service ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:3.2.0:jar (default-jar) # ccw-config-service ---
[INFO] Building jar: F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-config-service\target\ccw-config-service-1.0.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.4.3:repackage (repackage) # ccw-config-service ---
[INFO] Replacing main artifact with repackaged archive
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) # ccw-config-service ---
[INFO] Installing F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-config-service\target\ccw-config-service-1.0.jar to C:\Users\Admin\.m2\repository\com\doubleat\ccw\ccw-config-service\1.0\ccw
-config-service-1.0.jar
[INFO] Installing F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-config-service\pom.xml to C:\Users\Admin\.m2\repository\com\doubleat\ccw\ccw-config-service\1.0\ccw-config-service-1.0.pom
[INFO]
[INFO] -------------< com.doubleat.ccw:ccw-game-service-contract >-------------
[INFO] Building ccw-game-service-contract 1.0 [4/7]
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.2.0:resources (default-resources) # ccw-game-service-contract ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) # ccw-game-service-contract ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to F:\Workspace\Chinese-Chess-World\Public-Repo\Chinese-Chess-World\Chinese-Chess-World\ccw-game-service-contract\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /F:/Workspace/Chinese-Chess-World/Public-Repo/Chinese-Chess-World/Chinese-Chess-World/ccw-game-service-contract/src/main/java/com/doubleat/ccw/usermanagement/CcwGameServiceContractApplication.java:[3,40] package com.doubleat
.ccw.common.constant does not exist
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for ccw-platform 1.0:
[INFO]
[INFO] ccw-platform ....................................... SUCCESS [ 0.479 s]
[INFO] ccw-common ......................................... SUCCESS [ 2.070 s]
[INFO] ccw-config-service ................................. SUCCESS [ 0.585 s]
[INFO] ccw-game-service-contract .......................... FAILURE [ 0.666 s]
[INFO] ccw-game-service ................................... SKIPPED
[INFO] ccw-user-management-service-contract ............... SKIPPED
[INFO] ccw-user-management-service ........................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.110 s
[INFO] Finished at: 2021-02-27T19:21:18+07:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project ccw-game-service-contract: Compilation failure
[ERROR] /F:/Workspace/Chinese-Chess-World/Public-Repo/Chinese-Chess-World/Chinese-Chess-World/ccw-game-service-contract/src/main/java/com/doubleat/ccw/usermanagement/CcwGameServiceContractApplication.java:[3,40] package com.doubleat
.ccw.common.constant does not exist
[ERROR]
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project ccw-game-service-contract: Compilation failure
/F:/Workspace/Chinese-Chess-World/Public-Repo/Chinese-Chess-World/Chinese-Chess-World/ccw-game-service-contract/src/main/java/com/doubleat/ccw/usermanagement/CcwGameServiceContractApplication.java:[3,40] package com.doubleat.ccw.com
mon.constant does not exist
Problem Diagnostics
The spring-boot-maven-plugin executes for each of the modules in the project as evidenced by the following lines in Maven output:
[INFO] --- spring-boot-maven-plugin:2.4.3:repackage (repackage) # ccw-game-service-contract ---
[INFO] Replacing main artifact with repackaged archive
The JAR artifact of such modules is not a usual library after that, but an executable JAR packaged as described in the Spring Boot documentation
That executable JAR is not suitable for consumption by a Java compiler - or compiler for any other JVM-based language for that matter.
Solution
Only the Maven module which represents the final executable artifact of the project should include the invocation of the spring-boot-maven-plugin.
You may check the official guide from Spring Boot - Creating a Multi Module Project - for a step-by-step guide and explanation.

Maven dependency with sub multi module

I have this architecture
mmsb
|----pom.xml (packaging : pom) -> declare modules API and Utils
|----api
| |----pom.xml (packaging : pom) -> declare module api-slack / parent project
| |----api-slack
| |----pom.xml (packaging : pom) -> declare module api-slack-core / parent api
| |----api-slack-core
| |----pom.xml (packaging : jar) -> java code / parent api-slack
|----utils
| |----pom.xml (packaging : jar) -> java code / parent project / has dependency from api-slack-core
|
And it not works
With clean install from root Maven say :
~/dev/maven-multi-sub-projets ⌚ 11:03:48
$ mvn clean install -DskipTests
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] mmsb
[INFO] api
[INFO] api-slack
[INFO] api-slack-core
[INFO] utils
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building mmsb 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) # mmsb ---
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) # mmsb ---
[INFO] Installing /home/mario/dev/maven-multi-sub-projets/pom.xml to /opt/maven/m2repo/fr/app/mmsb/1.0-SNAPSHOT/mmsb-1.0-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building api 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) # api ---
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) # api ---
[INFO] Installing /home/mario/dev/maven-multi-sub-projets/api/pom.xml to /opt/maven/m2repo/fr/app/api/1.0-SNAPSHOT/api-1.0-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building api-slack 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) # api-slack ---
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) # api-slack ---
[INFO] Installing /home/mario/dev/maven-multi-sub-projets/api/api-slack/pom.xml to /opt/maven/m2repo/fr/app/api-slack/1.0-SNAPSHOT/api-slack-1.0-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building api-slack-core 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) # api-slack-core ---
[INFO] Deleting /home/mario/dev/maven-multi-sub-projets/api/api-slack/api-slack-core/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # api-slack-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # api-slack-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /home/mario/dev/maven-multi-sub-projets/api/api-slack/api-slack-core/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # api-slack-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # api-slack-core ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.18.1:test (default-test) # api-slack-core ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:2.6:jar (default-jar) # api-slack-core ---
[INFO] Building jar: /home/mario/dev/maven-multi-sub-projets/api/api-slack/api-slack-core/target/api-slack-core-1.0-SNAPSHOT.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:1.4.2.RELEASE:repackage (default) # api-slack-core ---
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) # api-slack-core ---
[INFO] Installing /home/mario/dev/maven-multi-sub-projets/api/api-slack/api-slack-core/target/api-slack-core-1.0-SNAPSHOT.jar to /opt/maven/m2repo/fr/app/api-slack-core/1.0-SNAPSHOT/api-slack-core-1.0-SNAPSHOT.jar
[INFO] Installing /home/mario/dev/maven-multi-sub-projets/api/api-slack/api-slack-core/pom.xml to /opt/maven/m2repo/fr/app/api-slack-core/1.0-SNAPSHOT/api-slack-core-1.0-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building utils 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.6.1:clean (default-clean) # utils ---
[INFO] Deleting /home/mario/dev/maven-multi-sub-projets/utils/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # utils ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # utils ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to /home/mario/dev/maven-multi-sub-projets/utils/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/mario/dev/maven-multi-sub-projets/utils/src/main/java/fr/app/utils/Application.java:[3,29] package fr.app.api.slack.core does not exist
[ERROR] /home/mario/dev/maven-multi-sub-projets/utils/src/main/java/fr/app/utils/Application.java:[11,13] cannot find symbol
symbol: class SlackService
location: class fr.app.utils.Application
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] mmsb ............................................... SUCCESS [ 0.213 s]
[INFO] api ................................................ SUCCESS [ 0.005 s]
[INFO] api-slack .......................................... SUCCESS [ 0.004 s]
[INFO] api-slack-core ..................................... SUCCESS [ 1.558 s]
[INFO] utils .............................................. FAILURE [ 0.113 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.197 s
[INFO] Finished at: 2016-12-15T11:03:52+01:00
[INFO] Final Memory: 32M/317M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project utils: Compilation failure: Compilation failure:
[ERROR] /home/mario/dev/maven-multi-sub-projets/utils/src/main/java/fr/app/utils/Application.java:[3,29] package fr.app.api.slack.core does not exist
[ERROR] /home/mario/dev/maven-multi-sub-projets/utils/src/main/java/fr/app/utils/Application.java:[11,13] cannot find symbol
[ERROR] symbol: class SlackService
[ERROR] location: class fr.app.utils.Application
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :utils
How to declare dependency of api-slack-core in utils ?
UPDATE
I upload code in this repository : https://github.com/mmaryo/mmsb
The problem is when I import fr.app.api.slack.core.SlackService inside fr.app.utils.Application
UPDATE 2
I found the problem, I removed :
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
Few things here -
At your parent pom level (project), why do you still have parent declared?
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.2.RELEASE</version>
</parent>
that too with
<packaging>pom</packaging>
and along with that why do you have
<module>api-slack</module>
<module>api-slack-core</module>
if they are supposed to be hierarchically within api -> api-slack -> api-slack-core. As an improvement please move module out within the project level as well.
Then at Api level, I doubt how even Api is building currently with incorrect parent name -
<parent>
<groupId>fr.app</groupId>
<artifactId>vishnou</artifactId> <!-- modified -->
<version>1.0-SNAPSHOT</version>
</parent>
Api-slack seems fine.
Api-slack-core can get rid of redundant empty
<dependencies></dependencies>
and specify a version for plugin(unless already defined in any of the parent poms) as -
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>x.y.z</version>
</plugin>
Further Utils can use Api-slack-core as a dependency and also please change
<groupId>fr.app</groupId>
<artifactId>utils</artifactId> <!--changed-->
Overall, I would suggest you to please go through a multi module example as suggested by the guide as well.
Try running mvn clean install -pl Utils -am ? where Utils is the name of the module in the parent-pom.
Maven Reactor should figure out the dependencies by itself - you just need to put the GAV (groupid, artifactid, version) of your dependencies.

Apache Tomcat 7 HTTP Connector node not found in intelliJ

I am developing an application using GWT, Maven on Apache Tomcat 7 with intelliJ idea. i have recently debugged and run my application but faced the following problem:Error running Tomcat 7: HTTP Connector node not found: set up one in the server.xml.
Apache Tomcat run code:
"c:\program files (x86)\jetbrains\intellij idea 11.1.4\jre\jre\bin\java" -Dclassworlds.conf=C:\Tools\apache-maven-3.1.1\bin\m2.conf -Dmaven.home=C:\Tools\apache-maven-3.1.1 -Dfile.encoding=UTF-8 -classpath C:\Tools\apache-maven-3.1.1\boot\plexus-classworlds-2.5.1.jar org.codehaus.classworlds.Launcher --offline --no-plugin-registry --fail-fast --strict-checksums --update-snapshots -f D:\Projects\ebank\pom.xml package -P gwtDebug,oracle
[WARNING] Command line option -npr is deprecated and will be removed in future Maven versions.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building AppFuse GWT Application 1.0
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.sun.xml.bind:jaxb-impl:jar:2.1.13 is missing, no dependency information available
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # AppfuseGWT ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 33 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) # AppfuseGWT ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- native2ascii-maven-plugin:1.0-beta-1:native2ascii (native2ascii-utf8) # AppfuseGWT ---
[INFO] Includes: [ApplicationResources_zh*.properties, ApplicationResources_ko*.properties, displaytag_zh*.properties]
[INFO] Excludes: []
[INFO]
[INFO] --- exec-maven-plugin:1.2:exec (default) # AppfuseGWT ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # AppfuseGWT ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 17 resources
[INFO] Copying 9 resources
[INFO]
[INFO] >>> hibernate3-maven-plugin:2.2:hbm2ddl (default) # AppfuseGWT >>>
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # AppfuseGWT ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 33 resources
[INFO]
[INFO] <<< hibernate3-maven-plugin:2.2:hbm2ddl (default) # AppfuseGWT <<<
[INFO]
[INFO] --- hibernate3-maven-plugin:2.2:hbm2ddl (default) # AppfuseGWT ---
[INFO] skipping hibernate3 execution
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) # AppfuseGWT ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- dbunit-maven-plugin:1.0-beta-3:operation (test-compile) # AppfuseGWT ---
[INFO] Skip operation: CLEAN_INSERT execution
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # AppfuseGWT ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- dbunit-maven-plugin:1.0-beta-3:operation (test) # AppfuseGWT ---
[INFO] Skip operation: CLEAN_INSERT execution
[INFO]
[INFO] --- gwt-maven-plugin:2.5.0:compile (gwtcompile) # AppfuseGWT ---
[INFO] uz.eopc.webapp.MainModuleDebug is up to date. GWT compilation skipped
[INFO]
[INFO] --- maven-war-plugin:2.3:war (default-war) # AppfuseGWT ---
[INFO] Packaging webapp
[INFO] Assembling webapp [AppfuseGWT] in [D:\Projects\ebank\target\AppfuseGWT-1.0]
[INFO] Processing war project
[INFO] Copying webapp webResources [D:\Projects\ebank\src/main/resources/packaged] to [D:\Projects\ebank\target\AppfuseGWT-1.0]
[INFO] Copying webapp resources [D:\Projects\ebank\src\main\webapp]
[INFO] Webapp assembled in [279 msecs]
[INFO] Building war: D:\Projects\ebank\target\AppfuseGWT-1.0.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.405s
[INFO] Finished at: Mon Dec 09 10:54:04 UZT 2013
[INFO] Final Memory: 12M/29M
[INFO] ------------------------------------------------------------------------
[INFO] Maven execution finished
What should be done to fix this problem?
I have found the answer to fix this problem. I was using ubuntu 12.04 and in linux systems everything is connected with permissions. After i have opened read and write permission to my tomcat directory, it has worked out. to open read and write permission to a directory in ubuntu just write:
$ sudo chmod 777 -R folder_name/

Categories