在Windows 7上的Solr中创建Maven工件时遇到问题

问题描述

|| 我正在尝试在Maven中构建solr 4.0快照。这是我的步骤: 在d:\\ workspace \\ solr中签出solr 下载ant,解压缩到d:\\ ant。将ANT_HOME设置为d:\\ ant 将maven-ant-tasks-2.1.3.jar(最新版本)下载到d:\\ ant \\ lib 在命令行中,转到d:\\ workspace \\ solr \\ lucene 运行命令: 蚂蚁生成专家文物 它给出了错误:
D:\\workspace\\solr\\lucene\\common-build.xml:326: #
    ##########################################################################
      Maven ant tasks not found.

      Please download the Maven ant tasks JAR (maven-ant-tasks-2.1.1.jar)
      from http://maven.apache.org/ant-tasks/download.html and add it to your
      $HOME/.ant/lib/ directory,or to your $ANT_HOME/lib/ directory,or
      to your $CLASSPATH,or add \"-lib /path/to/maven-ant-tasks-2.1.1.jar\"
      to the ant command.
    ##########################################################################

Total time: 0 seconds
我尝试跑步:
ant -lib d:\\ant\\lib generate-maven-artifacts
这是同样的错误。 仅运行蚂蚁就可以毫无问题地构建solr。 环境设定:
D:\\workspace\\solr\\lucene>ant -version
Apache Ant(TM) version 1.8.2 compiled on December 20 2010

D:\\workspace\\solr\\lucene>mvn --version
Apache Maven 2.2.1 (r801777; 2009-08-06 12:16:01-0700)
Java version: 1.6.0_24
Java home: C:\\Program Files (x86)\\Java\\jdk1.6.0_24\\jre
Default locale: en_US,platform encoding: Cp1252
OS name: \"windows 7\" version: \"6.1\" arch: \"x86\" Family: \"windows\"
有人可以帮忙吗?谢谢。     

解决方法

        我认为您需要像这样运行蚂蚁:
 ant -lib d:\\ant\\lib\\maven-ant-tasks-2.1.1.jar generate-maven-artifacts
类路径添加需要的文件引用(不是目录引用)。您也可以这样添加它:
 SET CLASSPATH=%CLASSPATH%;d:\\ant\\lib\\maven-ant-tasks-2.1.1.jar
 ant generate-maven-artifacts
    

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...