我正在尝试在本地启动并运行我们的项目。我在项目的根级别运行以下命令
mvn clean install -Plocal -PautoInstallPackage
并收到错误:
无法在项目 act-bundle 上执行目标:无法解析项目 com.wcm.act:act-bundle:bundle:2.1.30 的依赖项:无法在 io.wcm:io.wcm.t 收集依赖项 esting.aem-mock.junit4:jar:2.4.8 -> io.wcm:io.wcm.testing.aem-mock.core:jar:2.4.8 -> org.apache.commons:commons-imaging:jar: 1.0-R1534292
我正在使用 AEM 6.5、Maven 3.9.2、Java 8、Windows
这是我的完整 POM 文件:
<?xml version="1.0" encoding="UTF-8"?>
<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/maven-
v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.wcm.act</groupId>
<artifactId>act</artifactId>
<version>2.1.30</version>
<packaging>pom</packaging>
<name>Act Redesign AEM</name>
<description>Maven Multimodule project for ACT ORG.</description>
<prerequisites>
<maven>3.9.2</maven>
</prerequisites>
<!-- ====================================================================== -->
<!-- P R O P E R T I E S -->
<!-- ====================================================================== -->
<properties>
<!-- Encoding -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- Versions -->
<com.adobe.aem.uber-jar.version>6.5.17</com.adobe.aem.uber-jar.version>
<com.citrix.gototraining-api.version>0.11.0</com.citrix.gototraining-api.version>
<com.citrix.goto-core-lib.version>0.10.0</com.citrix.goto-core-lib.version>
<com.cognifide.cq.sling-dynamic-include.version>2.0.4</com.cognifide.cq.sling-dynamic-include.version>
<com.fasterxml.jackson.core.jackson-annotations.version>2.13.1</com.fasterxml.jackson.core.jackson-annotations.version>
<com.fasterxml.jackson.core.jackson-core.version>2.13.1</com.fasterxml.jackson.core.jackson-core.version>
<com.google.code.gson.version>2.8.9</com.google.code.gson.version>
<com.google.guava.version>12.0</com.google.guava.version>
<com.restfb.version>1.9.0</com.restfb.version>
<com.squareup.okhttp3>3.10.0</com.squareup.okhttp3>
<com.squareup.okio>1.14.0</com.squareup.okio>
<com.sun.jersey.jersey-bundle.version>1.19.1</com.sun.jersey.jersey-bundle.version>
<com.sun.xml.parsers.jaxp-ri.version>1.4.5</com.sun.xml.parsers.jaxp-ri.version>
<com.tinify>1.5.1</com.tinify>
<commons-httpclient.version>3.1</commons-httpclient.version>
<commons-io.version>2.4</commons-io.version>
<commons-lang.version>2.6</commons-lang.version>
<felix.scr.version>1.6.2</felix.scr.version>
<felix.scr.annotations.version>1.9.0</felix.scr.annotations.version>
<io.wcm.sling.commons.version>1.2.4</io.wcm.sling.commons.version>
<io.wcm.testing.aem-mock.version>2.4.8</io.wcm.testing.aem-mock.version>
<java.version>1.8</java.version>
<javax.inject.version>1</javax.inject.version>
<javax.jcr.version>2.0</javax.jcr.version>
<javax.servlet.servlet-api.version>3.1.0</javax.servlet.servlet-api.version>
<jaxen.version>1.1.4</jaxen.version>
<joda-time.version>1.6</joda-time.version>
<junit-addons.version>1.4</junit-addons.version>
<junit.version>4.10</junit.version>
<org.apache.commons.commons-lang3.version>3.12.0</org.apache.commons.commons-lang3.version>
<org.apache.commons.commons-email.version>1.1</org.apache.commons.commons-email.version>
<org.apache.felix.scr.annotations.version>1.6.0</org.apache.felix.scr.annotations.version>
<org.apache.httpcomponents.httpclient.version>4.0.3</org.apache.httpcomponents.httpclient.version>
<org.apache.sling.models.api.version>1.3.6</org.apache.sling.models.api.version>
<org.apache.sling.junit.core.version>1.0.26</org.apache.sling.junit.core.version>
<org.apache.sling.junit.scriptable.version>1.0.12</org.apache.sling.junit.scriptable.version>
<org.codehaus.jettison.version>1.3.1</org.codehaus.jettison.version>
<org.hamcrest.hamcrest-all.version>1.3</org.hamcrest.hamcrest-all.version>
<org.mockito.mockito-all.version>2.27.0</org.mockito.mockito-all.version>
<org.powermock.powermock-module-junit4.version>2.0.2</org.powermock.powermock-module-junit4.version>
<org.powermock.powermock-api-mockito.version>2.0.2</org.powermock.powermock-api-mockito.version>
<org.osgi.core.version>6.0.0</org.osgi.core.version>
<org.osgi.compendium.version>6.0.0</org.osgi.compendium.version>
<com.jcraft.jsch.version>0.1.53</com.jcraft.jsch.version>
<org.jdom.version>2.0.2</org.jdom.version>
<org.jsoup.version>1.7.1</org.jsoup.version>
<org.slf4j.slf4j-api.version>1.7.21</org.slf4j.slf4j-api.version>
<org.twitter4j.twitter4j-core.version>[4.0,)</org.twitter4j.twitter4j-core.version>
<rome.version>0.9</rome.version>
<xerces.version>2.8.0</xerces.version>
<!-- Directories -->
<rootdir>${project.basedir}</rootdir>
<checkstyle.root>${rootdir}/build-config/checkstyle</checkstyle.root>
<pmd.root>${rootdir}/build-config/pmd</pmd.root>
<project.reporting.outputDirectory />
<project.groupId>com.wcm.act</project.groupId>
<project.version>2.1.11-SNAPSHOT</project.version>
</properties>
<dependencyManagement>
<dependencies>
<!-- ********************************************* -->
<!-- Core Dependencies -->
<!-- ********************************************* -->
<!-- Adobe AEM Dependencies -->
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<version>${com.adobe.aem.uber-jar.version}</version>
<scope>provided</scope>
</dependency>
<!-- OSGi Dependencies -->
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.core</artifactId>
<version>${org.osgi.core.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.annotation</artifactId>
<version>6.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.cmpn</artifactId>
<version>${org.osgi.compendium.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.scr.annotations</artifactId>
<version>${org.apache.felix.scr.annotations.version}</version>
<scope>provided</scope>
</dependency>
<!-- Logging Dependencies -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${org.slf4j.slf4j-api.version}</version>
<scope>provided</scope>
</dependency>
<!-- Servlet API -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${javax.servlet.servlet-api.version}</version>
<scope>provided</scope>
</dependency>
<!-- JCR -->
<dependency>
<groupId>javax.jcr</groupId>
<artifactId>jcr</artifactId>
<version>${javax.jcr.version}</version>
<scope>provided</scope>
</dependency>
<!-- ********************************************* -->
<!-- Custom Code Dependencies -->
<!-- ********************************************* -->
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>${org.jsoup.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${org.apache.httpcomponents.httpclient.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${org.apache.commons.commons-lang3.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>${commons-lang.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-email</artifactId>
<version>${org.apache.commons.commons-email.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>${commons-httpclient.version}</version>
<scope>provided</scope>
<exclusions>
<exclusion> <!-- declare the exclusion here -->
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>rome</groupId>
<artifactId>rome</artifactId>
<version>${rome.version}</version>
</dependency>
<dependency>
<groupId>com.tinify</groupId>
<artifactId>tinify</artifactId>
<version>${com.tinify}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>${com.squareup.okhttp3}</version>
</dependency>
<dependency>
<groupId>com.squareup.okio</groupId>
<artifactId>okio</artifactId>
<version>${com.squareup.okio}</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-core</artifactId>
<version>1.11.221</version>
</dependency>
</dependencies>
</dependencyManagement>
<!-- Inclusion of repositories in POMs is controversial, to say the least.
It would be best if you proxied the Adobe repository using a Maven Repository
Manager. Once you do that, remove these sections. -->
<repositories>
<repository>
<id>apache</id>
<name>Apache Public Repository</name>
<url>http://repo.maven.apache.org/maven2</url>
<layout>default</layout>
</repository>
<repository>
<id>apache-snapshot</id>
<name>Apache Public Repository</name>
<url>http://repository.apache.org/snapshots</url>
<layout>default</layout>
</repository>
<repository>
<id>adobe-repo</id>
<name>Adobe Public Repository</name>
<url>https://repo.adobe.com/nexus/content/repositories/public/</url>
<layout>default</layout>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>adobe</id>
<name>Adobe Public Repository</name>
<url>https://repo.adobe.com/nexus/content/groups/public/</url>
<layout>default</layout>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.9.1</version>
<configuration>
<configLocation>${checkstyle.root}/act-checks.xml</configLocation>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<skip>true</skip>
<failOnViolation>true</failOnViolation>
<violationSeverity>warning</violationSeverity>
<suppressionsLocation>${checkstyle.root}/checkstyle-suppressions.xml</suppressionsLocation>
<suppressionsFileExpression>checkstyle.suppressions.file</suppressionsFileExpression>
<outputDirectory>${project.build.directory}/reports/checkstyle</outputDirectory>
<outputFile>${project.build.directory}/reports/checkstyle/checkstyle-result.xml</outputFile>
<outputFileFormat>xml</outputFileFormat>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<version>3.1</version>
<configuration>
<sourceEncoding>UTF-8</sourceEncoding>
<rulesets>
<ruleset>${pmd.root}/act-pmd.xml</ruleset>
</rulesets>
<targetDirectory>${project.build.directory}/reports/pmd</targetDirectory>
<outputDirectory>${project.build.directory}/reports/pmd</outputDirectory>
<aggregate>true</aggregate>
<skip>false</skip>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<id>enforce-java</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireJavaVersion>
<message>Project must be compiled with Java 8</message>
<version>${java.version}</version>
</requireJavaVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-scr-plugin</artifactId>
<version>1.7.4</version>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.5.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.7</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>2.4</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.14.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
</plugin>
<plugin>
<groupId>org.apache.sling</groupId>
<artifactId>maven-sling-plugin</artifactId>
<version>2.1.0</version>
<configuration>
<username>${cq.username}</username>
<password>${cq.password}</password>
</configuration>
</plugin>
<plugin>
<groupId>com.day.jcr.vault</groupId>
<artifactId>content-package-maven-plugin</artifactId>
<version>0.0.20</version>
<extensions>true</extensions>
<configuration>
<failOnError>true</failOnError>
<username>${cq.username}</username>
<password>${cq.password}</password>
</configuration>
</plugin>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.apache.felix
</groupId>
<artifactId>
maven-scr-plugin
</artifactId>
<versionRange>
[1.0.0,)
</versionRange>
<goals>
<goal>scr</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>local</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>env.type</name>
<value>local</value>
</property>
</activation>
<properties>
<cq.host>http://localhost</cq.host>
<cq.port>4502</cq.port>
<cq.user>admin</cq.user>
<cq.password>admin</cq.password>
</properties>
</profile>
<profile>
<id>local-publish</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<cq.host>http://localhost</cq.host>
<cq.port>4503</cq.port>
<cq.user>admin</cq.user>
<cq.password>admin</cq.password>
</properties>
</profile>
<profile>
<id>autoInstallPackage</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.day.jcr.vault</groupId>
<artifactId>content-package-maven-plugin</artifactId>
<configuration>
<verbose>true</verbose>
<failOnError>true</failOnError>
</configuration>
<executions>
<execution>
<id>install-package</id>
<goals>
<goal>install</goal>
</goals>
<phase>install</phase>
<configuration>
<targetURL>${cq.host}:${cq.port}/crx/packmgr/service.jsp?force=true</targetURL>
<userId>${cq.user}</userId>
<password>${cq.password}</password>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
<modules>
<module>act-bundle</module>
<module>act-config</module>
<module>act-ui</module>
<module>act-dispatcher</module>
</modules>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>2.5</version>
</plugin>
</plugins>
</reporting>
如果您从 maven 中央存储库下载,则该版本似乎不包含 jar 文件。您可以通过在项目 pom.xml 中的 dependencyManagement 标记中手动设置此工件的特定版本来修复它。或者如果是不必要的传递依赖,也可以手动排除。
如果您使用私有或特定的 Maven 工件存储库,您应该转到该存储库并搜索该工件以查看是否存在,或者是否有可用的替代版本。