-1

Ant パネルでサイト<Reference pomDeps not found>を取得していますが、ブロードリーフ コマースのデモサイトを起動できません。

jetty-demo を実行すると、次のエラーが表示されます。

Buildfile: C:\Users\queue_server\Documents\brodleaf-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.uniqueability:site at C:\Users\queue_server\Documents\brodleaf-workspace\DemoSite\site\pom.xml
[artifact:pom] 

BUILD FAILED
C:\Users\queue_server\Documents\brodleaf-workspace\DemoSite\site\build.xml:92: Unable to initialize POM pom.xml: Failed to validate POM for project com.[sitenameremoved]:site at C:\Users\queue_server\Documents\brodleaf-workspace\DemoSite\site\pom.xml

解決策が見つからないようです。アンインストールして再インストールしましたが、うまくいきませんでした。mvn -u を実行したところ、正しくビルドされました。Eclipseでは構築されません。

この問題に関する詳細情報はこちらです。私は同じ点で立ち往生しています

Windows 7、Eclipse Kepler Service Release 1 for Web Developers、maven 3.0.5、および ant 1.8.4 (embbebed) を使用していますが、pom を開始または呼び出す ant で build.xml ファイルを実行するときに問題が発生します。 xml ファイル。

これは build.xml ファイルです。実行しようとしているターゲットは jetty-demo で、このファイルは行 97 でファイル pom.xml を使用しています。

build.xml

<?xml version="1.0" encoding="UTF-8"?>
<project name="site" default="build-app" basedir="."
xmlns:artifact="antlib:org.apache.maven.artifact.ant"
xmlns:rsel="antlib:org.apache.tools.ant.types.resources.selectors">

<!-- import the ant / maven integration tasks -->
<path id="maven-ant-tasks.classpath" path="../lib/maven-ant-tasks-2.1.3.jar" />
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="antlib:org.apache.maven.artifact.ant" classpathref="maven-ant-tasks.classpath" />

<property name="project.root" location="../../"/>
<property name="project.name" value="site" />

<!-- See the following URL for a description of this property file strategy -->
<!-- The only difference is we prepend a . for the home directory property files -->
<!-- http://www.javaranch.com/ant/properties.jsp -->
<property file="${user.home}/.${project.name}.properties"/>
<property file="${user.home}/.build.properties"/>
<property name="config.filename" value="${user.name}.properties"/>
<property file="config/${config.filename}"/>
<property file="../build.properties"/>

<property name="runtime.environment" value="development"/>

<target name="jetty-demo-no-db">
        <delete dir="war/WEB-INF/lib"/>
        <artifact:mvn mavenHome="${maven.home}" fork="true">
            <jvmarg value="-XX:MaxPermSize=256M" />
            <jvmarg value="-Xmx512M" />
            <jvmarg value="-Xdebug" />
            <jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n" />
            <jvmarg value="-javaagent:${spring.instrument.path}" />
            <jvmarg value="-Druntime.environment=${runtime.environment}" />
            <arg value="compile"/>
            <arg value="war:exploded"/>
            <arg value="jetty:run"/>
        </artifact:mvn>
    </target>

<target name="jetty-demo" depends="start-db">
    <delete dir="war/WEB-INF/lib"/>
    <artifact:mvn mavenHome="${maven.home}" fork="true">
        <jvmarg value="-XX:MaxPermSize=256M" />
        <jvmarg value="-Xmx512M" />
        <jvmarg value="-Xdebug" />
        <jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n" />
        <jvmarg value="-javaagent:${spring.instrument.path}" />
        <jvmarg value="-Druntime.environment=${runtime.environment}" />  
        <arg value="compile"/>
        <arg value="war:exploded"/>
        <arg value="jetty:run"/>
    </artifact:mvn>
</target>

<target name="jetty-demo-jrebel" depends="start-db">
    <delete dir="war/WEB-INF/lib"/>
    <artifact:mvn mavenHome="${maven.home}" fork="true">
        <jvmarg value="-XX:MaxPermSize=256M" />
        <jvmarg value="-Xmx512M" />
        <jvmarg value="-Xdebug" />
        <jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n" />
        <jvmarg value="-Drebel.root=${project.root}" />
        <jvmarg value="-Dlogs.dir=${logs.dir}" />
        <jvmarg value="-noverify" />
        <jvmarg value="-javaagent:${jrebel.path}" />
        <jvmarg value="-javaagent:${spring.instrument.path}" />
        <jvmarg value="-Druntime.environment=${runtime.environment}" />  
        <arg value="compile"/>
        <arg value="war:exploded"/>
        <arg value="jetty:run"/>
    </artifact:mvn>
</target>

<target name="jetty-stop">
    <artifact:mvn mavenHome="${maven.home}" fork="true">
        <jvmarg value="-XX:MaxPermSize=256M" />
        <jvmarg value="-Xmx512M" />
        <arg value="jetty:stop"/>
    </artifact:mvn>
</target>

<target name="stop-all" depends="jetty-stop, stop-db"/>

<!-- Project Reference Targets -->
<!-- build the application and create the war artifact -->
<target name="build-app">
    <delete dir="war/WEB-INF/lib"/>
    <artifact:mvn mavenHome="${maven.home}" fork="true">
        <arg value="-Dmaven.test.skip=true"/>
        <arg value="install"/>
    </artifact:mvn>
</target>

<target name="start-db">
    <!-- retrieve the web project pom file and import its jar dependencies -->
    <echo>Maven Home:${maven.home}</echo>
    <echo>User Home:${user.home}</echo>
    <artifact:pom id="warPom" file="pom.xml"/>
    <artifact:dependencies filesetId="warDeps" pomRefId="warPom" useScope="test" />
    <path id="build.runtime.classpath">
        <fileset refid="warDeps"/>
    </path>

    <echo message="Starting Data Base..." />
    <java fork="true"  spawn="true" classname="org.hsqldb.Server" classpathref="build.runtime.classpath">
        <arg  line="-database.0 file:data/broadleaf -dbname.0 broadleaf"/>
    </java>
</target>

<target name="stop-db">
    <echo message="Execute SQL on new Data Base..." />
    <artifact:pom id="warPom" file="pom.xml"/>
    <artifact:dependencies filesetId="warDeps" pomRefId="warPom" useScope="test" />
    <path id="build.runtime.classpath">
        <fileset refid="warDeps"/>
    </path>
    <sql
        autocommit="true"
        print="true"
        classpathref="build.runtime.classpath"
        driver="org.hsqldb.jdbcDriver"
        url="jdbc:hsqldb:hsql://localhost/broadleaf;ifexists=true"
        userid="sa"
        password="">
        <transaction>SHUTDOWN</transaction>
    </sql>
    <echo message="SQL Executed on data base..." />
</target>

<target name="build-create-sql" >
    <!--wrapping spring instrument jar-->
    <echo>
         Creating schema insert files
    </echo>
    <mkdir dir="target/sql/create"/>
    <java  classname="org.apache.tools.ant.launch.Launcher"
            fork="true"
            failonerror="true"
            dir="."
            timeout="4000000"
            taskname="startAnt">
            <classpath>
             <pathelement location="${ant.home}/lib/ant-launcher.jar"/>
            </classpath>
            <!--uncomment the following spring insturment jar argument if you require spring instrument-->
            <jvmarg value="-javaagent:${spring.instrument.path}"/>
            <jvmarg value="-XX:MaxPermSize=512M" />
            <jvmarg value="-Xmx1024M" />
            <arg value="-buildfile"/>
            <arg file="build.xml"/>
            <arg value="create-sql"/>
      </java>
</target>

<target name="create-sql">
    <!--
        You will need to run a mvn install on your project before attempting to execute this task.
        Also, you will likely need to assign additional heap space to your ANT process. A setting
        of -XX:MaxPermSize=256M -Xmx512M should be sufficient.

        This can be done by populating the 'ANT_OPTS' environment variable:
            export ANT_OPTS=-XX:MaxPermSize=256M -Xmx512M
        which will ensure those settings for all ant processes. Alternatively you could use JAVA_OPTS which is for
        the global JVM and will effect all Java processes.
    -->
    <mkdir dir="target/sql/create"/>
    <artifact:pom id="myPom" file="pom.xml" />
    <!-- This fileset is will be immediately overridden by the artifact:dependencies element. This is only declared here
        to make eclipse not give a warning about this -->
    <fileset dir="dir" id="pomDeps" />
    <artifact:dependencies filesetId="pomDeps" pomRefId="myPom" useScope="compile" />
    <property name="baseTarget" location="target/${myPom.build.finalName}/WEB-INF"/>
    <fileset id="libDir" dir="${baseTarget}/lib"/>
    <path id="build.runtime.classpath">
        <!--There are some additional libraries needed at compile time that are not included
            in WEB-INF/lib - find those libraries via a difference algorithm-->
        <restrict>
            <difference>
                <fileset refid="pomDeps" />
                <intersect>
                    <fileset refid="pomDeps" />
                    <fileset refid="libDir" />
                </intersect>
            </difference>
            <rsel:not>
                <rsel:name name="**/*.pom" />
            </rsel:not>
        </restrict>
        <!--Add the lib directory to get all the dependencies required for the demo app-->
        <fileset refid="libDir"/>
        <dirset dir="src/main/resources" />
        <!--Add the classes directory in the war project, if required-->
        <!--<pathelement location="${baseTarget}/classes"/>-->
    </path>
    <!--If the war project does not contain custom entities (best practice), then it is not necessary to include application context from the WEB-INF directory-->
    <!--<property name="my.app.context" location="src/main/webapp/WEB-INF/applicationContext.xml"/>-->
    <taskdef name="hibernatetool" classname="org.broadleafcommerce.common.util.sql.HibernateToolTask" classpathref="build.runtime.classpath"/>
    <hibernatetool destDir="target/sql/create" combinePersistenceUnits="false" refineFileNames="true">
        <!--add in additional persistence configuration related to the cms -->
        <classPathApplicationContext path="bl-cms-contentClient-applicationContext.xml"/>
        <classPathApplicationContext path="bl-open-admin-contentClient-applicationContext.xml"/>
        <!--add in additional persistence configuration for our core -->
        <classPathApplicationContext path="applicationContext.xml"/>
        <!--see description for my.app.context above -->
        <fileSystemApplicationContext path="src/main/webapp/WEB-INF/applicationContext.xml"/>
        <classPathApplicationContext path="bl-fake-applicationContext-ant.xml"/>
        <!--select the dialects and persistence units to export-->
        <jpaconfiguration persistenceUnit="blPU" dialect="${ant.hibernate.sql.ddl.dialect}" />
        <jpaconfiguration persistenceUnit="blSecurePU" dialect="${ant.hibernate.sql.ddl.dialect}" />
        <jpaconfiguration persistenceUnit="blCMSStorage" dialect="${ant.hibernate.sql.ddl.dialect}" />
        <!--other required elements-->
        <classpath refid="build.runtime.classpath" />
        <hbm2ddl export="false" update="false" create="true"/>
    </hibernatetool>
</target>

<target name="build-update-sql" >
    <!--wrapping spring instrument jar-->
    <echo>
         Creating schema insert files
    </echo>
    <mkdir dir="target/sql/create"/>
    <java  classname="org.apache.tools.ant.launch.Launcher"
            fork="true"
            failonerror="true"
            dir="."
            timeout="4000000"
            taskname="startAnt">
            <classpath>
             <pathelement location="${ant.home}/lib/ant-launcher.jar"/>
            </classpath>
            <!--uncomment the following spring insturment jar argument if you require spring instrument-->
            <jvmarg value="-javaagent:${spring.instrument.path}"/>
            <jvmarg value="-XX:MaxPermSize=512M" />
            <jvmarg value="-Xmx1024M" />
            <arg value="-buildfile"/>
            <arg file="build.xml"/>
            <arg value="update-sql"/>
      </java>
</target>

<target name="update-sql">
    <!--
        You will need to run a mvn install on your project before attempting to execute this task.
        Also, you will likely need to assign additional heap space to your ANT process. A setting
        of -XX:MaxPermSize=256M -Xmx512M should be sufficient.

        This can be done by populating the 'ANT_OPTS' environment variable:
            export ANT_OPTS=-XX:MaxPermSize=256M -Xmx512M
        which will ensure those settings for all ant processes. Alternatively you could use JAVA_OPTS which is for
        the global JVM and will effect all Java processes.
    -->
    <mkdir dir="target/sql/update"/>
    <artifact:pom id="myPom" file="pom.xml" />

    <!-- This fileset is will be immediately overridden by the artifact:dependencies element. This is only declared here
        to make eclipse not give a warning about this -->
    <fileset dir="dir" id="pomDeps" />
    <artifact:dependencies filesetId="pomDeps" pomRefId="myPom" useScope="compile" />
    <property name="baseTarget" location="target/${myPom.build.finalName}/WEB-INF"/>
    <fileset id="libDir" dir="${baseTarget}/lib"/>
    <path id="build.runtime.classpath">
        <!--There are some additional libraries needed at compile time that are not included
            in WEB-INF/lib - find those libraries via a difference algorithm-->
        <restrict>
            <difference>
                <fileset refid="pomDeps" />
                <intersect>
                    <fileset refid="pomDeps" />
                    <fileset refid="libDir" />
                </intersect>
            </difference>
            <rsel:not>
                <rsel:name name="**/*.pom" />
            </rsel:not>
        </restrict>
        <!--Add the lib directory to get all the dependencies required for the demo app-->
        <fileset refid="libDir"/>
        <dirset dir="src/main/resources" />
        <!--Add the classes directory in the war project, if required-->
        <!--<pathelement location="${baseTarget}/classes"/>-->
    </path>
    <!--If the war project does not contain custom entities (best practice), then it is not necessary to include application context from the WEB-INF directory-->
    <!--<property name="my.app.context" location="src/main/webapp/WEB-INF/applicationContext.xml"/>-->
    <taskdef name="hibernatetool" classname="org.broadleafcommerce.common.util.sql.HibernateToolTask" classpathref="build.runtime.classpath" />
    <hibernatetool destDir="target/sql/update" combinePersistenceUnits="false" refineFileNames="true">
        <!--add in additional persistence configuration related to the cms -->
        <classPathApplicationContext path="bl-cms-contentClient-applicationContext.xml"/>
        <classPathApplicationContext path="bl-open-admin-contentClient-applicationContext.xml"/>
        <!--add in additional persistence configuration for our core -->
        <classPathApplicationContext path="applicationContext.xml"/>
        <!--see description for my.app.context above -->
        <fileSystemApplicationContext path="src/main/webapp/WEB-INF/applicationContext.xml"/>
        <classPathApplicationContext path="bl-fake-applicationContext-ant.xml"/>
        <!--select the dialects and persistence units to export-->
        <jpaconfiguration persistenceUnit="blPU" dialect="${ant.hibernate.sql.ddl.dialect}" 
            url="${ant.blPU.url}" 
            userName="${ant.blPU.userName}" 
            password="${ant.blPU.password}" 
            driverClassName="${ant.blPU.driverClassName}"/>
        <jpaconfiguration persistenceUnit="blSecurePU" dialect="${ant.hibernate.sql.ddl.dialect}" 
            url="${ant.blSecurePU.url}" 
            userName="${ant.blSecurePU.userName}" 
            password="${ant.blSecurePU.password}" 
            driverClassName="${ant.blSecurePU.driverClassName}"/>
        <jpaconfiguration persistenceUnit="blCMSStorage" dialect="${ant.hibernate.sql.ddl.dialect}" 
            url="${ant.blCMSStorage.url}" 
            userName="${ant.blCMSStorage.userName}" 
            password="${ant.blCMSStorage.password}" 
            driverClassName="${ant.blCMSStorage.driverClassName}"/>
        <!--other required elements-->
        <classpath refid="build.runtime.classpath" />
        <hbm2ddl export="false" update="true" create="false"/>
    </hibernatetool>
</target>
</project>

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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
    <groupId>pe.equifax</groupId>
    <artifactId>ecommerce-website</artifactId>
    <version>1.0</version>
</parent>
<artifactId>site</artifactId>
<packaging>war</packaging>
<name>site</name>
<description>Web Module For Broadleaf Commerce Based ECommerce Site</description>
<properties>
    <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <!-- httpsPort and httpPort are used by embeded jetty server.-->
    <!-- Make sure the following httpsPort matches what's in the runtime-properties file,  -->
    <httpsPort>8443</httpsPort> 
    <httpPort>8080</httpPort>
</properties>
<build>
    <outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>
    <finalName>equifax</finalName>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <configuration>
                <webappDirectory>${webappDirectory}</webappDirectory>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <version>8.1.5.v20120716</version>
            <configuration>
                <webAppSourceDirectory>${webappDirectory}</webAppSourceDirectory>
                <contextPath>/</contextPath>
                <stopPort>9966</stopPort>
                <stopKey>foo</stopKey>
                <connectors>
                    <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                        <port>${httpPort}</port>

                        <maxIdleTime>60000</maxIdleTime>
                    </connector>
                    <connector implementation="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
                        <port>${httpsPort}</port>
                        <keystore>${webappDirectory}/WEB-INF/blc-example.keystore</keystore>
                        <keyPassword>broadleaf</keyPassword>
                        <password>broadleaf</password>
                    </connector>
                </connectors>
                <webAppConfig>
                     <allowDuplicateFragmentNames>true</allowDuplicateFragmentNames>
                </webAppConfig>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>keytool-maven-plugin</artifactId>
            <version>1.2</version>
            <executions>
                <execution>
                    <phase>generate-resources</phase>
                    <id>clean</id>
                    <goals>
                        <goal>clean</goal>
                    </goals>
                </execution>
                <execution>
                    <phase>generate-resources</phase>
                    <id>genkey</id>
                    <goals>
                        <goal>genkey</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <keystore>${webappDirectory}/WEB-INF/blc-example.keystore</keystore>
                <dname>cn=localhost</dname>
                <keypass>broadleaf</keypass>
                <storepass>broadleaf</storepass>
                <alias>broadleaf</alias>
                <keyalg>RSA</keyalg>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.zeroturnaround</groupId>
            <artifactId>jrebel-maven-plugin</artifactId>
            <configuration>
                <packaging>war</packaging>
                <rootPath>${basedir}</rootPath>
            </configuration>
            <executions>
                <execution>
                    <id>generate-rebel-xml</id>
                    <phase>process-resources</phase>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>
<dependencies>
    <dependency>
        <groupId>jdk.tools</groupId>
        <artifactId>jdk.tools</artifactId>
        <version>1.7.0_45</version>
        <scope>system</scope>
        <systemPath>${JAVA_HOME}/lib/tools.jar</systemPath>
    </dependency>
    <dependency>
        <groupId>pe.equifax</groupId>
        <artifactId>core</artifactId>
    </dependency>
    <dependency>
        <groupId>org.broadleafcommerce</groupId>
        <artifactId>broadleaf-framework-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.hsqldb</groupId>
        <artifactId>hsqldb</artifactId>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
    </dependency>
    <dependency>
        <groupId>org.apache.tomcat</groupId>
        <artifactId>tomcat-jdbc</artifactId>
    </dependency>
    <dependency>
        <groupId>commons-dbcp</groupId>
        <artifactId>commons-dbcp</artifactId>
    </dependency>
</dependencies>
</project>

output : build.xml で jetty-demo ターゲットを実行した後

Buildfile: C:\Tools\eclipse_workspaces\DemoSite-3.0.6-GA-eworkspace\eclipse-workspace\DemoSite\site\build.xml
start-db:
 [echo] Maven Home:C:/Tools/Tools/apache-maven-3.0.5
 [echo] User Home:C:\Users\kcondezo
[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 pe.equifax:site at C:\Tools\eclipse_workspaces\DemoSite-3.0.6-GA-eworkspace\eclipse-workspace\DemoSite\site\pom.xml
[artifact:pom] 

BUILD FAILED
C:\Tools\eclipse_workspaces\DemoSite-3.0.6-GA-eworkspace\eclipse-workspace\DemoSite\site\build.xml:97: Unable to initialize POM pom.xml: Failed to validate POM for project pe.equifax:site at C:\Tools\eclipse_workspaces\DemoSite-3.0.6-GA-eworkspace\eclipse-workspace\DemoSite\site\pom.xml

Total time: 4 seconds

build.properties :

#required
maven.home=C:/Tools/Tools/apache-maven-3.0.5
#optional
#jrebel.path=/usr/lib/jrebel/jrebel.jar

#optional for build-create-sql and build-update-sql ant tasks
ant.hibernate.sql.ddl.dialect=org.hibernate.dialect.HSQLDialect

#The following allow the build-update-sql ant task to connect to a database and generate DDL to 
#update the schema
ant.blPU.url=jdbc:hsqldb:hsql://localhost/broadleaf
ant.blPU.userName=sa
ant.blPU.password=null
ant.blPU.driverClassName=org.hsqldb.jdbcDriver

ant.blSecurePU.url=jdbc:hsqldb:hsql://localhost/broadleaf
ant.blSecurePU.userName=sa
ant.blSecurePU.password=null
ant.blSecurePU.driverClassName=org.hsqldb.jdbcDriver

ant.blCMSStorage.url=jdbc:hsqldb:hsql://localhost/broadleaf
ant.blCMSStorage.userName=sa
ant.blCMSStorage.password=null
ant.blCMSStorage.driverClassName=org.hsqldb.jdbcDriver

#Required for correct operation of some 3rd party modules
#Relative paths are from the ant build.xml files, so site/build.xml and     admin/build.xml.
spring.instrument.path=../lib/spring-instrument-3.2.2.RELEASE.jar

#End build-*-sql Ant Task Properties

このリンクでいくつかの調査を行いましたが、それぞれに少なくとも原因の診断があります(たとえば、間違った依存関係)。私の場合、この診断はありません。pom.xml ファイルを maven install で実行すると、問題なく実行されます。

http://forum.broadleafcommerce.org/viewtopic.php?f=14&t=2326&p=6478&hilit=jetty+demo+validate+pom#p6478

http://mail-archives.apache.org/mod_mbox/maven-users/200802.mbox/%3Cf0c159810802020349m6d770b56wdd56f58c4d05e1d8@mail.gmail.com%3E

https://jira.codehaus.org/browse/MANTTASKS-207

PreparedStatement間違って使用しているため、画像が挿入されませんでした。あなたは使用する必要がありますか?それらの 1 つだけでなく、すべてのパラメーターに対して。

4

2 に答える 2