无法初始化POM pom.xml:无法验证POM

时间:2014-05-20 06:56:48

标签: java xml spring maven broadleaf-commerce

启动jetty-demo时,我面临以下错误。

你能帮我解决一下吗?

我的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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.mycompany</groupId>
    <artifactId>ecommerce-website</artifactId>
    <version>1.0</version>
    <packaging>pom</packaging>
    <name>ecommerce</name>
    <url>http://www.blc-archetype.com</url>
    <properties>
        <blc.version>3.1.2-GA</blc.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <description>My Company's eCommerce Website</description>
    <repositories>
        <repository>
            <id>public snapshots</id>
            <name>public snapshots</name>
            <url>http://nexus.broadleafcommerce.org/nexus/content/repositories/snapshots/</url>
        </repository>
        <repository>
            <id>public releases</id>
            <name>public releases</name>
            <url>http://nexus.broadleafcommerce.org/nexus/content/repositories/releases/</url>
        </repository>
    </repositories>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <!-- Needed for Eclipse Indigo -->
                    <!-- This plugin does not actually exist, but is instead read by Eclipse 
                        for configuration purposes -->
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.zeroturnaround</groupId>
                                        <artifactId>jrebel-maven-plugin</artifactId>
                                        <versionRange>[1.0,)</versionRange>
                                        <goals>
                                            <goal>generate</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>org.apache.maven.plugins</groupId>
                                        <artifactId>maven-antrun-plugin</artifactId>
                                        <versionRange>[1.3,)</versionRange>
                                        <goals>
                                            <goal>run</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore />
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.codehaus.mojo
                                        </groupId>
                                        <artifactId>
                                            build-helper-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [1.7,)
                                        </versionRange>
                                        <goals>
                                            <goal>
                                                timestamp-property
                                            </goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.codehaus.mojo
                                        </groupId>
                                        <artifactId>
                                            keytool-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [1.2,)
                                        </versionRange>
                                        <goals>
                                            <goal>clean</goal>
                                            <goal>genkey</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.0.2</version>
                    <configuration>
                        <source>1.6</source>
                        <target>1.6</target>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.zeroturnaround</groupId>
                    <artifactId>jrebel-maven-plugin</artifactId>
                    <version>1.1.3</version>
                </plugin>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>1.7</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.10</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-war-plugin</artifactId>
                    <version>2.1.1</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-jar-plugin</artifactId>
                    <version>2.3.2</version>
                </plugin>
                <plugin>
                    <artifactId>maven-clean-plugin</artifactId>
                    <configuration>
                        <excludeDefaultDirectories>true</excludeDefaultDirectories>
                        <filesets>
                            <!-- delete directories that will be generated when you start the 
                                develpment server/client in eclipse -->
                            <fileset>
                                <directory>target</directory>
                                <includes>
                                    <include>**/*</include>
                                </includes>
                            </fileset>
                        </filesets>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.mycompany</groupId>
                <artifactId>core</artifactId>
                <version>1.0</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>

            <!--Broadleaf libraries -->
            <dependency>
                <groupId>org.broadleafcommerce</groupId>
                <artifactId>broadleaf-common</artifactId>
                <version>${blc.version}</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>org.broadleafcommerce</groupId>
                <artifactId>broadleaf-profile</artifactId>
                <version>${blc.version}</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>org.broadleafcommerce</groupId>
                <artifactId>broadleaf-profile-web</artifactId>
                <version>${blc.version}</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>org.broadleafcommerce</groupId>
                <artifactId>broadleaf-framework</artifactId>
                <version>${blc.version}</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>org.broadleafcommerce</groupId>
                <artifactId>broadleaf-framework-web</artifactId>
                <version>${blc.version}</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>org.broadleafcommerce</groupId>
                <artifactId>broadleaf-admin-module</artifactId>
                <version>${blc.version}</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>org.broadleafcommerce</groupId>
                <artifactId>broadleaf-contentmanagement-module</artifactId>
                <version>${blc.version}</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>org.broadleafcommerce</groupId>
                <artifactId>broadleaf-open-admin-platform</artifactId>
                <version>${blc.version}</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>org.broadleafcommerce</groupId>
                <artifactId>integration</artifactId>
                <version>${blc.version}</version>
                <type>jar</type>
                <classifier>tests</classifier>
                <scope>test</scope>
            </dependency>

            <!-- Other dependencies -->
            <dependency>
                <groupId>org.hsqldb</groupId>
                <artifactId>hsqldb</artifactId>
                <version>2.3.1</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>commons-dbcp</groupId>
                <artifactId>commons-dbcp</artifactId>
                <version>1.4</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>servlet-api</artifactId>
                <version>2.5</version>
                <type>jar</type>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>5.9</version>
                <type>jar</type>
                <classifier>jdk15</classifier>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>tomcat-jdbc</artifactId>
                <version>7.0.30</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <modules>
        <module>admin</module>
        <module>core</module>
        <module>site</module>
    </modules>
</project>
Complete Error message -

Buildfile: Z:\broadleaf\eclipse-workspace\DemoSite\site\build.xml
start-db:
[artifact:pom] An error has occurred while processing the Maven artifact tasks.
[artifact:pom] Diagnosis:
[artifact:pom]
[artifact:pom] Unable to initialize POM pom.xml: Failed to validate POM for project com.mycompany:site at
     

Z:\阔叶\ Eclipse的工作空间\ DemoSite \站点\的pom.xml       [伪影:POM]

BUILD FAILED
Z:\broadleaf\eclipse-workspace\DemoSite\site\build.xml:95: Unable to initialize POM pom.xml: Failed to validate POM for project
     

com.mycompany:site at   Z:\阔叶\ Eclipse的工作空间\ DemoSite \站点\ pom.xml的

1 个答案:

答案 0 :(得分:0)

将site-build.xml中的以下代码替换为start-db和stop-db ant任务:

<!-- retrieve the web project pom file and import its jar dependencies -->
         <artifact:pom id="warPom" file="pom.xml"/>
         <artifact:dependencies filesetId="warDeps" pomRefId="warPom" useScope="test" />

   <!-- Grab the HSQLDB jar and add it to the classpath -->
         <artifact:dependencies filesetId="warDeps">
             <dependency groupId="org.hsqldb" artifactId="hsqldb" version="2.3.1" />
         </artifact:dependencies>

另外,替换 -

<artifact:pom id="warPom" file="pom.xml"/>
<artifact:dependencies filesetId="warDeps" pomRefId="warPom" useScope="test" />

<!-- Grab the HSQLDB jar and add it to the classpath -->
        <artifact:dependencies filesetId="warDeps">
            <dependency groupId="org.hsqldb" artifactId="hsqldb" version="2.3.1" />
        </artifact:dependencies>