2013-05-03 117 views
5

我试图用maven部署AEM,所以我按照this tutorial。当我运行命令MVN清包,我得到以下错误:用maven部署AEM(错误)

C:\workspace\myproject\app>mvn clean package 
[INFO] Scanning for projects... 
[WARNING] The POM for com.day.jcr.vault:maven-vault-plugin:jar:0.0.10 is missing 
, no dependency information available 
[ERROR] The build could not read 1 project -> [Help 1] 
[ERROR] 
[ERROR] The project com.uum:app:1-SNAPSHOT (C:\workspace\myproject\app\pom.xml 
) has 3 errors 
[ERROR]  Unresolveable build extension: Plugin com.day.jcr.vault:maven-vault- 
plugin:0.0.10 or one of its dependencies could not be resolved: Failure to find 
com.day.jcr.vault:maven-vault-plugin:jar:0.0.10 in http://repo.maven.apache.org/ 
maven2 was cached in the local repository, resolution will not be reattempted un 
til the update interval of central has elapsed or updates are forced -> [Help 2] 

[ERROR]  Unknown packaging: content-package @ line 12, column 16 
[ERROR]  'dependencies.dependency.groupId' for :core:jar is missing. @ line 1 
8, column 22 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit 
ch. 
[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 rea 
d the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildin 
gException 
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginResoluti 
onException 

我的myproject /应用/ pom.xml的是这样的:

<?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> 
    <parent> 
     <groupId>com.uum</groupId> 
     <artifactId>parent</artifactId> 
     <relativePath>../parent/pom.xml</relativePath> 
     <version>1-SNAPSHOT</version> 
    </parent> 

    <artifactId>app</artifactId> 
    <packaging>content-package</packaging> 

    <name>Sample Application package</name> 

    <dependencies> 
     <dependency> 
      <groupId><!-- {groupId} --></groupId> 
      <artifactId>core</artifactId> 
      <version>${project.version}</version>      
     </dependency> 

     <!-- add additional dependencies --> 
    </dependencies> 

    <build> 
     <resources> 
      <resource> 
       <directory>${basedir}/META-INF</directory> 
       <targetPath>../vault-work/META-INF</targetPath> 
      </resource> 
      <resource> 
       <directory>${basedir}/jcr_root</directory> 
       <excludes> 
        <exclude>**/.vlt</exclude> 
        <exclude>**/.vltignore</exclude> 
        <exclude>**/*.iml</exclude> 
        <exclude>**/.classpath</exclude> 
        <exclude>**/.project</exclude> 
        <exclude>**/.DS_Store</exclude> 
        <exclude>**/target/**</exclude> 
        <exclude>libs/**</exclude> 
       </excludes> 
      </resource> 
     </resources> 

     <plugins> 

      <plugin> 
       <groupId>com.day.jcr.vault</groupId> 
       <artifactId>maven-vault-plugin</artifactId> 
       <extensions>true</extensions> 
       <configuration> 
        <group>Sample</group> 
        <requiresRoot>true</requiresRoot> 

        <install>true</install> 
        <verbose>true</verbose> 

        <packageFile>${project.build.directory}/${project.artifactId}-${project.version}.zip</packageFile> 

        <version>${project.version}</version> 
        <properties> 
         <acHandling>overwrite</acHandling> 
        </properties> 

        <embeddeds> 
         <embedded> 
          <groupId><!-- {groupId} --></groupId> 
          <artifactId>core</artifactId> 
          <target><!-- {install path in the repository (e.g. /apps/myproject/install)} --></target> 
         </embedded> 
        </embeddeds> 
       </configuration> 
      </plugin> 

     </plugins> 
    </build> 

    <profiles> 
     <profile> 
      <id>installPackages</id> 
      <activation> 
      </activation> 
      <build> 
       <plugins> 
        <plugin> 
         <groupId>com.day.jcr.vault</groupId> 
         <artifactId>maven-vault-plugin</artifactId> 
         <executions> 
          <execution> 
           <id>install-package</id> 
           <goals> 
            <goal>install</goal> 
           </goals> 
          </execution> 
         </executions> 
        </plugin> 
       </plugins> 
      </build> 
     </profile> 
    </profiles> 

</project> 

任何想法如何得到部署与Maven作品?

回答

5

它看起来maven不知道在哪里可以找到maven-vault-plugin。您需要将Adobe存储库添加到maven POM中,请参阅http://repo.adobe.com/

这将导致Unresolveable build extension: Plugin com.day.jcr.vault:maven-vault- plugin:0.0.10错误和Unknown packaging: content-package @ line 12, column 16错误。

此外,您还需要在代码中留下一些需要替换的教程中的一些可变占位符(<groupId><!-- {groupId} --></groupId>)。请参阅错误:

[ERROR]  'dependencies.dependency.groupId' for :core:jar is missing. @ line 18, column 22 

在Vault插件配置的<embeddeds>部分,您可以指定您希望包括Maven依赖。这个例子可以在这个Managing packages with Maven页面中看到。

如果您现在不想在包中包含任何外部依赖关系,则可以完全删除<embeddeds>部分。

+0

谢谢你的回答。将Adobe存储库添加到setting.xml后,此问题已解决,但其他问题已打印在控制台上:[错误]无法执行目标项目应用程序:无法解析依赖关系 r project com.uum:app:content -package:1-SNAPSHOT:未找到com.uum:核心:j ar:1-SNAPSHOT在http://repo.adobe.com/nexus/content/groups/public/中被缓存了i n本地存储库,直到.. – 2013-05-05 11:18:57

+0

我的myproject/core/pom.xml可以找到它们:https://www.dropbox.com/s/fydv7zw83v8wl9s/pom.xml不会重新解析。示例myproject可以在https://www.dropbox.com/s/fogbxcky6ndvs6l/myproject.zip找到。希望有人可以提供帮助 – 2013-05-05 11:27:30

+0

如果您有其他问题,最好再添加一个问题 – diffa 2013-05-08 08:59:07

1

确保您在构建项目之前启动了CQ/AEM。出现很多熟悉Vault和Maven的错误是因为它。