我在我的蚂蚁小组中找到了网站<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并正确构建。它不会在日食中构建。
这里有关于这个问题的更多信息,我被困在同一点
我正在使用Windows 7,eclipse用于Web开发人员的Kepler Service Release 1,maven 3.0.5和ant 1.8.4(emmbebed),当我想使用启动或调用的ant运行build.xml文件时,我遇到了问题一个pom.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>
输出:在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
我已经在这个链接中进行了一些研究,但是每个链接至少都有一个原因的诊断(例如错误的依赖)。在我的情况下,我没有这个诊断,当我使用maven install运行pom.xml文件时,它运行没有问题:
https://jira.codehaus.org/browse/MANTTASKS-207
答案 0 :(得分:0)
确保您已在build.properties中更改maven home。 例如:maven.home = / usr / local / Cellar / maven / 3.1.1 / libexec
build.properties位于主项目下。你会发现它。
答案 1 :(得分:0)
我刚刚解决了同样的问题
“start-db” ant目标不起作用,因此 I did this tutorial 。它解释了如何更改为MySQL。
您将使用的用户拥有所有权限和密码非常重要。 没有密码,它对我不起作用。完成本教程后,转到“jetty-demo-no-db” ant目标。 需要几分钟,但它会为您创建整个数据库。