得到错误" OakConstraint0021"使用Maven部署AEM项目时

时间:2016-12-13 15:59:33

标签: eclipse maven aem jackrabbit

我正在尝试将我的自定义项目代码从AEM 6.0迁移到AEM 6.2。我已使用uber-jar通过项目pom文件进行更新,当我构建项目(maven build)时,它显示以下错误代码:

  

请求失败:com.day.jcr.vault.packaging.PackageException:   org.apache.jackrabbit.vault.packaging.PackageException:   javax.jcr.nodetype.ConstraintViolationException:OakConstraint0021:   /apps/veritas/components/content/logo/dialog/hero3.html/jcr:content[[nt:resource]:   强制属性jcr:在新节点中找不到数据(500)

我的项目pom.xml:

http://maven.apache.org/maven-v4_0_0.xsd">     4.0.0     com.veritas.wcm     VERITAS     POM     1.0-SNAPSHOT     VERITAS

<modules>
    <module>core</module>
    <module>ui.apps</module>
    <!--module>ui.content</module -->
    <!--module>it.tests</module -->
    <!--module>it.launcher</module -->
</modules>

<properties>
    <aem.host>localhost</aem.host>
    <aem.port>4505</aem.port>
    <aem.user>admin</aem.user>
    <aem.password>admin</aem.password>
    <aem.publish.host>localhost</aem.publish.host>
    <aem.publish.port>4503</aem.publish.port>
    <sling.user>admin</sling.user>
    <sling.password>admin</sling.password>
    <vault.user>admin</vault.user>
    <vault.password>admin</vault.password>
</properties>
<build>
    <plugins>
        <!-- Maven Release Plugin -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>2.5.1</version>
            <configuration>
                <scmCommentPrefix>[maven-scm] :</scmCommentPrefix>
                <preparationGoals>clean install</preparationGoals>
                <goals>install</goals>
                <releaseProfiles>release</releaseProfiles>
            </configuration>
        </plugin>
        <!-- Maven Source Plugin -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.4</version>
            <inherited>true</inherited>
        </plugin>
        <!-- Maven Resources Plugin -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <configuration>
                <encoding>UTF-8</encoding>
            </configuration>
        </plugin>
        <!-- Maven Jar Plugin -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.5</version>
        </plugin>
        <!-- Maven Enforcer Plugin -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-enforcer-plugin</artifactId>
            <executions>
                <execution>
                    <id>enforce-maven</id>
                    <goals>
                        <goal>enforce</goal>
                    </goals>
                    <configuration>
                        <rules>
                            <requireMavenVersion>
                                <version>[2.2.1,)</version>
                            </requireMavenVersion>
                            <requireJavaVersion>
                                <message>Project must be compiled with Java 6 or higher</message>
                                <version>1.6.0</version>
                            </requireJavaVersion>
                        </rules>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <!-- Maven Compiler 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>
        <!-- Maven IntelliJ IDEA Plugin -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-idea-plugin</artifactId>
            <version>2.2.1</version>
            <configuration>
                <jdkLevel>1.6</jdkLevel>
                <linkModules>true</linkModules>
                <downloadSources>true</downloadSources>
            </configuration>
        </plugin>
        <!-- Maven Eclipse Plugin -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-eclipse-plugin</artifactId>
            <version>2.9</version>
            <configuration>
                <downloadSources>true</downloadSources>
            </configuration>
        </plugin>
    </plugins>
    <pluginManagement>
        <plugins>
            <!-- Maven Clean Plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>2.6.1</version>
            </plugin>
            <!-- Maven Resources Plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.7</version>
            </plugin>
            <!-- Maven Compiler Plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
            </plugin>
            <!-- Apache Felix SCR Plugin -->
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-scr-plugin</artifactId>
                <version>1.20.0</version>
                <executions>
                    <execution>
                        <id>generate-scr-scrdescriptor</id>
                        <goals>
                            <goal>scr</goal>
                        </goals>
                        <configuration>
                            <!-- Private service properties for all services. -->
                            <properties>
                                <service.vendor>Adobe</service.vendor>
                            </properties>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <outputDirectory>${project.build.directory}/classes</outputDirectory>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-simple</artifactId>
                        <version>1.5.11</version>
                    </dependency>
                </dependencies>
            </plugin>
            <!-- Maven Installer Plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>2.5.2</version>
            </plugin>
            <!-- Maven Surefire Plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.18.1</version>
            </plugin>
            <!-- Maven Failsafe Plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.18.1</version>
            </plugin>
            <!-- Maven Deploy Plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>2.8.2</version>
            </plugin>
            <!-- Apache Sling Plugin -->
            <plugin>
                <groupId>org.apache.sling</groupId>
                <artifactId>maven-sling-plugin</artifactId>
                <version>2.1.0</version>
                <!-- <executions>
                    <execution>
                        <goals>
                            <goal>install</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <slingUrl>http://${aem.host}:${aem.port}/crx/repository/crx.default</slingUrl>
                    <usePut>true</usePut>
                    <failOnError>true</failOnError>
                </configuration> -->
            </plugin>
            <!-- Content Package Plugin -->
            <plugin>
                <groupId>com.day.jcr.vault</groupId>
                <artifactId>content-package-maven-plugin</artifactId>
                <version>0.0.24</version>
                <configuration>
                    <targetURL>http://${aem.host}:${aem.port}/crx/packmgr/service.jsp</targetURL>
                    <failOnError>true</failOnError>
                    <failOnMissingEmbed>true</failOnMissingEmbed>
                </configuration>
            </plugin>
            <!-- Apache Felix Bundle Plugin -->
            <plugin>
                <groupId>org.apache.felix</groupId>
                <artifactId>maven-bundle-plugin</artifactId>
                <version>2.5.3</version>
                <inherited>true</inherited>
            </plugin>
            <!-- Maven Enforcer Plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>1.4</version>
            </plugin>
            <!-- Maven Dependency Plugin -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.10</version>
            </plugin>
            <!-- Build Helper Maven Plugin -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.9.1</version>
            </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.maven.plugins</groupId>
                                    <artifactId>maven-enforcer-plugin</artifactId>
                                    <versionRange>[1.0.0,)</versionRange>
                                    <goals>
                                        <goal>enforce</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore />
                                </action>
                            </pluginExecution>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>
                                        org.apache.maven.plugins
                                    </groupId>
                                    <artifactId>
                                        maven-dependency-plugin
                                    </artifactId>
                                    <versionRange>
                                        [2.2,)
                                    </versionRange>
                                    <goals>
                                        <goal>copy-dependencies</goal>
                                        <goal>unpack</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore />
                                </action>
                            </pluginExecution>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>
                                        org.codehaus.mojo
                                    </groupId>
                                    <artifactId>
                                        build-helper-maven-plugin
                                    </artifactId>
                                    <versionRange>
                                        [1.5,)
                                    </versionRange>
                                    <goals>
                                        <goal>
                                            reserve-network-port
                                        </goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore />
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>

<profiles>
    <!-- ====================================================== -->
    <!-- A D O B E P U B L I C P R O F I L E -->
    <!-- ====================================================== -->
    <profile>
        <id>adobe-public</id>

        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>

        <properties>
            <releaseRepository-Id>adobe-public-releases</releaseRepository-Id>
            <releaseRepository-Name>Adobe Public Releases</releaseRepository-Name>
            <releaseRepository-URL>http://repo.adobe.com/nexus/content/groups/public</releaseRepository-URL>
        </properties>

        <repositories>
            <repository>
                <id>adobe-public-releases</id>
                <name>Adobe Public Repository</name>
                <url>http://repo.adobe.com/nexus/content/groups/public</url>
                <releases>
                    <enabled>true</enabled>
                    <updatePolicy>never</updatePolicy>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>
        </repositories>

        <pluginRepositories>
            <pluginRepository>
                <id>adobe-public-releases</id>
                <name>Adobe Public Repository</name>
                <url>http://repo.adobe.com/nexus/content/groups/public</url>
                <releases>
                    <enabled>true</enabled>
                    <updatePolicy>never</updatePolicy>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </pluginRepository>
        </pluginRepositories>
    </profile>
</profiles>


<!-- ====================================================================== -->
<!-- D E P E N D E N C I E S -->
<!-- ====================================================================== -->
<dependencyManagement>
    <dependencies>
        <!-- OSGi Dependencies -->
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.scr</artifactId>
            <version>1.6.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.felix</groupId>
            <artifactId>org.apache.felix.scr.annotations</artifactId>
            <version>1.9.6</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>biz.aQute</groupId>
            <artifactId>bndlib</artifactId>
            <version>1.50.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.3.1</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.core</artifactId>
            <version>4.2.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.osgi</groupId>
            <artifactId>org.osgi.compendium</artifactId>
            <version>4.2.0</version>
            <scope>provided</scope>
        </dependency>
        <!-- Logging Dependencies -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.5.11</version>
            <scope>provided</scope>
        </dependency>
        <!-- Apache Sling Dependencies -->
        <dependency>
            <groupId>com.adobe.aem</groupId>
            <artifactId>uber-jar</artifactId>
            <version>6.2.0</version>
            <classifier>obfuscated-apis</classifier>
            <scope>provided</scope>
        </dependency>
        <!-- Servlet API -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.sling</groupId>
            <artifactId>org.apache.sling.commons.json</artifactId>
            <version>2.0.6</version>
            <scope>provided</scope>
        </dependency>
        <!-- JCR -->
        <dependency>
            <groupId>javax.jcr</groupId>
            <artifactId>jcr</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>
        <!-- ACS Commons -->
        <dependency>
            <groupId>com.adobe.acs</groupId>
            <artifactId>acs-aem-commons-bundle</artifactId>
            <version>1.10.4</version>
            <scope>provided</scope>
        </dependency>
        <!-- JSoup -->
        <dependency>
            <groupId>org.jsoup</groupId>
            <artifactId>jsoup</artifactId>
            <version>1.7.2</version>
            <scope>provided</scope>
        </dependency>
        <!-- Testing -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>1.5.11</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-all</artifactId>
            <version>1.9.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit-addons</groupId>
            <artifactId>junit-addons</artifactId>
            <version>1.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-httpclient</groupId>
            <artifactId>commons-httpclient</artifactId>
            <version>3.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20080701</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.4.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient-osgi</artifactId>
            <version>4.4.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore</artifactId>
            <version>4.4.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpcore-osgi</artifactId>
            <version>4.4.1</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-io</artifactId>
            <version>1.3.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.sun.mail</groupId>
            <artifactId>javax.mail</artifactId>
            <version>1.5.2</version>
        </dependency>
    </dependencies>
</dependencyManagement>

1 个答案:

答案 0 :(得分:1)

如果我理解正确,您正在尝试部署内容页面(示例或预建页面)。它有一个嵌入式资源,但资源丢失,导致节点约束异常。 AFAIK和nt:资源节点需要内容二进制数据。

您是否可以检查您的包过滤器是否正在获取此路径的图像/二进制文件?包已在6.0和6.2之间更改