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.
Related
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
I have a Java application which should be run with mvn spring-boot:run -Dspring.profiles.active=dev -Djasypt.encryptor.password=<DJASYPT_ENCRYPTOR_PASSWORD>.
If I just run that command I get this:
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for ie.avis.digital.account:accapiapp:jar:1.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.apache.httpcomponents:httpclient:jar -> version (?) vs 4.5.3 # ie.avis.digital.account:accapiapp:[unknown-version], C:\DevTools\git\api.account\accapiapp\pom.xml, line 156, column 15
[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] accapi
[INFO] accapiapp
Downloading: https://binaries.avisgroup.com:443/artifactory/public-maven/org/eclipse/m2e/lifecycle-mapping/1.0.0/lifecycle-mapping-1.0.0.pom
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0
Downloading: https://binaries.avisgroup.com:443/artifactory/public-maven/org/codehaus/mojo/maven-metadata.xml
Downloading: https://binaries.avisagroup.com:443/artifactory/public-maven/org/apache/maven/plugins/maven-metadata.xml
Downloaded: https://binaries.avisgroup.com:443/artifactory/public-maven/org/apache/maven/plugins/maven-metadata.xml (10 kB at 1.2 kB/s)
Downloaded: https://binaries.avisgroup.com:443/artifactory/public-maven/org/codehaus/mojo/maven-metadata.xml (20 kB at 299 B/s)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] accapi ......................................... SKIPPED
[INFO] accapiapp ...................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:12 min
[INFO] Finished at: 2022-01-11T19:10:33Z
[INFO] Final Memory: 13M/209M
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'spring-boot' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\A183540\.m2\repository), avis-nexus (https://binaries.avisagroup.com:443/artifactory/public-maven/)] -> [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/NoPluginFoundForPrefixException
I don't think I should need to add this to the accapi pom:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.12.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
and this to plugins
If I do and run the mvn command I get this:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
I get this:
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for ie.avis.digital.account:accapiapp:jar:1.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.apache.httpcomponents:httpclient:jar -> version (?) vs 4.5.3 # ie.avis.digital.account:accapiapp:[unknown-version], C:\DevTools\git\api.account\accapiapp\pom.xml, line 156, column 15
[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] accapi
[INFO] accapiapp
Downloading: https://binaries.avisgroup.com:443/artifactory/public-maven/org/eclipse/m2e/lifecycle-mapping/1.0.0/lifecycle-mapping-1.0.0.pom
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building accapi 1.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0
[INFO]
[INFO] >>> spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) > test-compile # accapi >>>
[INFO]
[INFO] <<< spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) < test-compile # accapi <<<
[INFO]
[INFO]
[INFO] --- spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) # accapi ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building accapiapp 1.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) > test-compile # accapiapp >>>
[INFO]
[INFO] --- buildnumber-maven-plugin:1.4:create (2) # accapiapp ---
[INFO] Executing: cmd.exe /X /C "git rev-parse --verify HEAD"
[INFO] Working directory: C:\DevTools\git\api.account\accapiapp
[INFO] Storing buildNumber: b9bd8c84473a4d0f5ab3f0e0f9a24a92620850d8 at timestamp: 1641928952817
[INFO] Storing buildScmBranch: develop
[INFO]
[INFO] --- buildnumber-maven-plugin:1.4:create-metadata (1) # accapiapp ---
[INFO] Executing: cmd.exe /X /C "git rev-parse --verify HEAD"
[INFO] Working directory: C:\DevTools\git\api.account\accapiapp
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # accapiapp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] Copying 20 resources
[INFO] Copying 1 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) # accapiapp ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # accapiapp ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 15 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) # accapiapp ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] <<< spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) < test-compile # accapiapp <<<
[INFO]
[INFO]
[INFO] --- spring-boot-maven-plugin:1.5.12.RELEASE:run (default-cli) # accapiapp ---
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] accapi ......................................... SUCCESS [ 0.997 s]
[INFO] accapiapp ...................................... SUCCESS [ 4.948 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.137 s
[INFO] Finished at: 2022-01-11T19:22:35Z
[INFO] Final Memory: 33M/258M
[INFO] ------------------------------------------------------------------------
Even if I was correct to do this I'd expect the application to remain running. Is there anything obvious that I'm doing wrong?
I had to cd accapiapp then run my mvn command.
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.
I'm trying to create a custom archetype which defines a substantial pom.xml and includes a couple of source files.
None of the sources I define in my archetype.xml are included when generate a project using this archetype (the pom.xml is generated as expected).
My archetype.xml is located in src/main/resources/META-INF/maven and defines two sources.
<archetype xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype/1.0.0 http://maven.apache.org/xsd/archetype-1.0.0.xsd">
<id>custom-archetype</id>
<sources>
<source>src/main/java/App.java</source>
</sources>
<resources>
<resource>src/test/java/BatFile.bat</resource>
</resources>
</archetype>
App.java is located in src/main/resources/archetype-resources/src/main/java.
BatFile.bat is located in src/main/resources/archetype-resources/src/main/resources.
I also have an archetype-metadata.xml located in src/main/resources/META-INF/maven which I use to define dependency version
<?xml version="1.0" encoding="UTF-8"?>
<archetype-descriptor name="custom">
<requiredProperties>
<requiredProperty key="thorntail-version">
<defaultValue>2.2.1.Final</defaultValue>
</requiredProperty>
</requiredProperties>
</archetype-descriptor>
My root pom.xml is as follows
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>uk.co.xxxxx</groupId>
<artifactId>custom-archetype</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Custom Archetype</name>
<description>Archetype for Custom projects</description>
</project>
I'm following the maven Documentation on creating custom archetypes and as far as I can see I'm doing everything correctly.
This is the result of running mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreade
d.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Custom Archetype 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # custom-archetype ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 6 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) # custom-archetype ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # custom-archetype ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) custom-archetype ---
[INFO] No sources to compile
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) # custom-archetype
---
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # custom-archetype ---
[INFO] --- maven-install-plugin:2.4:install (default-install) # custom-archetype
---
[INFO] Installing D:\dev\customarchetype\target\custom-archetype-0.0.1-SNAPSHOT.jar to C:\Users\xxxx\.m2\repository\uk\co\xxxxx\custom-archetype\0
.0.1-SNAPSHOT\custom-archetype-0.0.1-SNAPSHOT.jar
[INFO] Installing D:\dev\custom\customarchetype\pom.xml to C:\Users\xxxx\.m2\rep
ository\uk\co\xxxxx\custom-archetype\0.0.2-SNAPSHOT\custom-archetype-0.0.
1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.849 s
[INFO] Finished at: 2019-01-11T09:29:18+00:00
[INFO] Final Memory: 8M/245M
[INFO] ------------------------------------------------------------------------
I'm running the following maven command to generate my project
mvn archetype:generate -DarchetypeGroupId=uk.co.gamma.xxxxx -DarchetypeArtifactId=custom-archetype -DarchetypeVersion=0.0.1-SNAPSHOT -DgroupId=uk.co.xxxxx -Dversion=0.0.1-SNAPSHOT -DartifactId=test12 -Dpackage=uk.co.xxxxx
and this is the output
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:3.0.1:generate (default-cli) # standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:3.0.1:generate (default-cli) # standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:3.0.1:generate (default-cli) # standalone-pom ---
[INFO] Generating project in Interactive mode
[INFO] Archetype repository not defined. Using the one from [uk.co.xxxxx:custom-archetype:0.0.1-SNAPSHOT] found in catalog local
[INFO] Using property: groupId = uk.co.xxxxx
[INFO] Using property: artifactId = test12
[INFO] Using property: version = 0.0.1-SNAPSHOT
[INFO] Using property: package = uk.co.xxxxx
[INFO] Using property: thorntail-version = 2.2.1.Final
Confirm properties configuration:
groupId: uk.co.xxxxx
artifactId: test12
version: 0.0.1-SNAPSHOT
package: uk.co.xxxxx
thorntail-version: 2.2.1.Final
Y: :
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: custom-archetype:0.0.1-SNAPSHOT
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: uk.co.xxxxx
[INFO] Parameter: artifactId, Value: test12
[INFO] Parameter: version, Value: 0.0.1-SNAPSHOT
[INFO] Parameter: package, Value: uk.co.xxxxx
[INFO] Parameter: packageInPathFormat, Value: uk/co/xxxxx
[INFO] Parameter: package, Value: uk.co.xxxxx
[INFO] Parameter: version, Value: 0.0.1-SNAPSHOT
[INFO] Parameter: thorntail-version, Value: 2.2.1.Final
[INFO] Parameter: groupId, Value: uk.co.xxxxx
[INFO] Parameter: artifactId, Value: test12
[INFO] Project created from Archetype in dir: D:\dev\testarchetype\test12
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.281 s
[INFO] Finished at: 2019-01-11T10:27:45+00:00
[INFO] Final Memory: 13M/183M
[INFO] ------------------------------------------------------------------------
The generated project only contains pom.xml.
What do I need to do to include these files when generating a project from this archetype?
archetype-metadata.xml is an archetype 2.x descriptor whereas archetype.xml is an archetype 1.x descriptor. Using both means anything in archetype.xml is ignored. Including file generation in archetype-metadata.xml and deleting archetype.xml fixes the problem.
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