[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Old (1.x) Archetype: maven-archetype-quickstart:1.1
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: basedir, Value: /home/lius/codes/java/maven/springframework/sf
[INFO] Parameter: package, Value: com.lius.sf
[INFO] Parameter: groupId, Value: com.lius.sf
[INFO] Parameter: artifactId, Value: lesson01
[INFO] Parameter: packageName, Value: com.lius.sf
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 37.226 s
[INFO] Finished at: 2022-07-07T22:24:01+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.2.1:generate (default-cli) on project sf: Unable to add module to the current project as it is not of packaging type 'pom' -> [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
翻译:Unable to add module to the current project as it is not of packaging type 'pom'
原因:在maven项目下创建module的前提条件是该maven项目的pom.xml文件的packaging 是pom,而不是jar
解决方案:将父级maven项目的pom.xml文件的packaging 改为pom即可。