我试图在没有手动更新git子模块的情况下部署我的项目。 我正在尝试使用maven exec插件来执行maven命令时更新子模块。 我的完整项目是这样的:
s3s3l/
├── app
│ ├── LICENSE
│ ├── pom.xml
│ ├── pom.xml.versionsBackup
│ ├── README.md
│ ├── src
│ └── target
├── common
│ ├── LICENSE
│ ├── pom.xml
│ ├── pom.xml.versionsBackup
│ ├── README.md
│ ├── src
│ └── target
├── data
│ ├── LICENSE
│ ├── pom.xml
│ ├── pom.xml.versionsBackup
│ ├── README.md
│ ├── src
│ └── target
├── excel
│ ├── LICENSE
│ ├── pom.xml
│ ├── pom.xml.versionsBackup
│ ├── README.md
│ ├── src
│ └── target
├── http
│ ├── LICENSE
│ ├── pom.xml
│ ├── pom.xml.versionsBackup
│ ├── README.md
│ ├── src
│ └── target
├── jdbc
│ ├── LICENSE
│ ├── pom.xml
│ ├── pom.xml.versionsBackup
│ ├── README.md
│ ├── src
│ └── target
├── LICENSE.md
├── mail
│ ├── LICENSE
│ ├── pom.xml
│ ├── pom.xml.versionsBackup
│ ├── README.md
│ ├── src
│ └── target
├── mybatis
│ ├── LICENSE
│ ├── pom.xml
│ ├── pom.xml.versionsBackup
│ ├── README.md
│ ├── src
│ └── target
├── parent
│ ├── pom.xml
│ └── pom.xml.versionsBackup
├── pom.xml
├── pom.xml.versionsBackup
├── README.md
├── redis
│ ├── LICENSE
│ ├── pom.xml
│ ├── pom.xml.versionsBackup
│ ├── README.md
│ ├── src
│ └── target
├── resource
│ ├── LICENSE
│ ├── pom.xml
│ ├── pom.xml.versionsBackup
│ ├── README.md
│ ├── src
│ └── target
├── security
│ ├── LICENSE
│ ├── pom.xml
│ ├── pom.xml.versionsBackup
│ ├── README.md
│ ├── src
│ └── target
├── target
│ └── checkout
├── utils
│ ├── LICENSE
│ ├── pom.xml
│ ├── pom.xml.versionsBackup
│ ├── README.md
│ ├── src
│ └── target
├── web
│ ├── bin
│ ├── LICENSE
│ ├── pom.xml
│ ├── pom.xml.versionsBackup
│ ├── README.md
│ ├── src
│ └── target
└── websocket
├── bin
├── LICENSE
├── pom.xml
├── pom.xml.versionsBackup
├── README.md
├── src
└── target
这是我的顶级pom.xml:
<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>com.s3s3l</groupId>
<artifactId>moudel-parent</artifactId>
<packaging>pom</packaging>
<scm>
<developerConnection>scm:git:ssh://git@github.com/S3S3L/s3s3l</developerConnection>
<tag>HEAD</tag>
</scm>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<inherited>false</inherited> <!-- only execute these in the parent -->
<executions>
<execution>
<id>git submodule update</id>
<phase>initialize</phase>
<configuration>
<executable>git</executable>
<arguments>
<argument>submodule</argument>
<argument>update</argument>
<argument>--init</argument>
<argument>--recursive</argument>
</arguments>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<parent>
<groupId>com.s3s3l</groupId>
<artifactId>s3s3l-parent</artifactId>
<version>2.1.0-SNAPSHOT</version>
<relativePath>parent</relativePath>
</parent>
<modules>
<module>parent</module>
<module>web</module>
<module>app</module>
<module>excel</module>
<module>http</module>
<module>jdbc</module>
<module>data</module>
<module>mail</module>
<module>mybatis</module>
<module>redis</module>
<module>resource</module>
<module>security</module>
<module>utils</module>
<module>common</module>
<module>websocket</module>
</modules>
</project>
这是我执行maven命令的目录:
checkout
├── app
├── common
├── data
├── excel
├── http
├── jdbc
├── LICENSE.md
├── mail
├── mybatis
├── parent
├── pom.xml
├── pom.xml.versionsBackup
├── README.md
├── redis
├── resource
├── security
├── utils
├── web
└── websocket
所有子模块目录都是空的。
我收到此错误:
Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 1.8.0_151, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-103-generic", arch: "amd64", family: "unix"
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG] Imported: javax.enterprise.inject.* < plexus.core
[DEBUG] Imported: javax.enterprise.util.* < plexus.core
[DEBUG] Imported: javax.inject.* < plexus.core
[DEBUG] Imported: org.apache.maven.* < plexus.core
[DEBUG] Imported: org.apache.maven.artifact < plexus.core
[DEBUG] Imported: org.apache.maven.classrealm < plexus.core
[DEBUG] Imported: org.apache.maven.cli < plexus.core
[DEBUG] Imported: org.apache.maven.configuration < plexus.core
[DEBUG] Imported: org.apache.maven.exception < plexus.core
[DEBUG] Imported: org.apache.maven.execution < plexus.core
[DEBUG] Imported: org.apache.maven.execution.scope < plexus.core
[DEBUG] Imported: org.apache.maven.lifecycle < plexus.core
[DEBUG] Imported: org.apache.maven.model < plexus.core
[DEBUG] Imported: org.apache.maven.monitor < plexus.core
[DEBUG] Imported: org.apache.maven.plugin < plexus.core
[DEBUG] Imported: org.apache.maven.profiles < plexus.core
[DEBUG] Imported: org.apache.maven.project < plexus.core
[DEBUG] Imported: org.apache.maven.reporting < plexus.core
[DEBUG] Imported: org.apache.maven.repository < plexus.core
[DEBUG] Imported: org.apache.maven.rtinfo < plexus.core
[DEBUG] Imported: org.apache.maven.settings < plexus.core
[DEBUG] Imported: org.apache.maven.toolchain < plexus.core
[DEBUG] Imported: org.apache.maven.usability < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.* < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.authentication < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.authorization < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.events < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.observers < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.proxy < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.repository < plexus.core
[DEBUG] Imported: org.apache.maven.wagon.resource < plexus.core
[DEBUG] Imported: org.codehaus.classworlds < plexus.core
[DEBUG] Imported: org.codehaus.plexus.* < plexus.core
[DEBUG] Imported: org.codehaus.plexus.classworlds < plexus.core
[DEBUG] Imported: org.codehaus.plexus.component < plexus.core
[DEBUG] Imported: org.codehaus.plexus.configuration < plexus.core
[DEBUG] Imported: org.codehaus.plexus.container < plexus.core
[DEBUG] Imported: org.codehaus.plexus.context < plexus.core
[DEBUG] Imported: org.codehaus.plexus.lifecycle < plexus.core
[DEBUG] Imported: org.codehaus.plexus.logging < plexus.core
[DEBUG] Imported: org.codehaus.plexus.personality < plexus.core
[DEBUG] Imported: org.codehaus.plexus.util.xml.Xpp3Dom < plexus.core
[DEBUG] Imported: org.codehaus.plexus.util.xml.pull.XmlPullParser < plexus.core
[DEBUG] Imported: org.codehaus.plexus.util.xml.pull.XmlPullParserException < plexus.core
[DEBUG] Imported: org.codehaus.plexus.util.xml.pull.XmlSerializer < plexus.core
[DEBUG] Imported: org.eclipse.aether.* < plexus.core
[DEBUG] Imported: org.eclipse.aether.artifact < plexus.core
[DEBUG] Imported: org.eclipse.aether.collection < plexus.core
[DEBUG] Imported: org.eclipse.aether.deployment < plexus.core
[DEBUG] Imported: org.eclipse.aether.graph < plexus.core
[DEBUG] Imported: org.eclipse.aether.impl < plexus.core
[DEBUG] Imported: org.eclipse.aether.installation < plexus.core
[DEBUG] Imported: org.eclipse.aether.internal.impl < plexus.core
[DEBUG] Imported: org.eclipse.aether.metadata < plexus.core
[DEBUG] Imported: org.eclipse.aether.repository < plexus.core
[DEBUG] Imported: org.eclipse.aether.resolution < plexus.core
[DEBUG] Imported: org.eclipse.aether.spi < plexus.core
[DEBUG] Imported: org.eclipse.aether.transfer < plexus.core
[DEBUG] Imported: org.eclipse.aether.version < plexus.core
[DEBUG] Imported: org.slf4j.* < plexus.core
[DEBUG] Imported: org.slf4j.helpers.* < plexus.core
[DEBUG] Imported: org.slf4j.spi.* < plexus.core
[DEBUG] Populating class realm maven.api
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /usr/share/maven/conf/settings.xml
[DEBUG] Reading user settings from /home/zwei/.m2/settings.xml
[DEBUG] Reading global toolchains from /usr/share/maven/conf/toolchains.xml
[DEBUG] Reading user toolchains from /home/zwei/.m2/toolchains.xml
[DEBUG] Using local repository at /home/zwei/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10.0 for /home/zwei/.m2/repository
[INFO] Scanning for projects...
[DEBUG] Extension realms for project com.s3s3l:moudel-parent:pom:2.1.0: (none)
[DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[plexus.core, parent: null]
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/parent/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/web/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/app/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/excel/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/http/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/jdbc/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/data/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/mail/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/mybatis/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/redis/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/resource/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/security/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/utils/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/common/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/websocket/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
@
[ERROR] The build could not read 1 project -> [Help 1]
org.apache.maven.project.ProjectBuildingException: Some problems were encountered while processing the POMs:
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/parent/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/web/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/app/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/excel/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/http/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/jdbc/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/data/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/mail/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/mybatis/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/redis/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/resource/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/security/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/utils/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/common/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/websocket/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist @
at org.apache.maven.project.DefaultProjectBuilder.build(DefaultProjectBuilder.java:422)
at org.apache.maven.graph.DefaultGraphBuilder.collectProjects(DefaultGraphBuilder.java:419)
at org.apache.maven.graph.DefaultGraphBuilder.getProjectsForMavenReactor(DefaultGraphBuilder.java:410)
at org.apache.maven.graph.DefaultGraphBuilder.build(DefaultGraphBuilder.java:83)
at org.apache.maven.DefaultMaven.buildGraph(DefaultMaven.java:491)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:219)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR]
[ERROR] The project com.s3s3l:moudel-parent:2.1.0 (/home/zwei/github/s3s3l/target/checkout/pom.xml) has 15 errors
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/parent/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/web/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/app/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/excel/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/http/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/jdbc/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/data/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/mail/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/mybatis/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/redis/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/resource/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/security/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/utils/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/common/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist
[ERROR] Child module /home/zwei/github/s3s3l/target/checkout/websocket/pom.xml of /home/zwei/github/s3s3l/target/checkout/pom.xml does not exist
[ERROR]
[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/ProjectBuildingException
似乎maven exec插件配置无法正常工作。我该如何解决这个问题?
答案 0 :(得分:0)
之前描述过这种任务在这里工作:“How to get Maven release to clone git submodules?”
但是:它没有<inherited>false</inherited>
行。
它必须在项目的顶层文件夹(克隆git repo的地方)中运行,target/checkout subfolder
中的不是,它不是git存储库。