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

发布于 2024-11-12 23:14:05 字数 1497 浏览 5 评论 0原文

我正在尝试在 Maven 中构建 solr 4.0 快照。我的步骤如下:

  1. 在d:\workspace\solr中查看solr
  2. 下载ant,解压到d:\ant。将 ANT_HOME 设置为 d:\ant
  3. 在命令行中下载 maven-ant-tasks-2.1.3.jar(最新版本)到 d:\ant\lib
  4. ,进入 d:\workspace\solr\lucene
  5. 运行命令: antgenerate-maven-artifacts

它给出了错误:

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

这是相同的错误。

单独运行 ant 将毫无问题地构建 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"

有人可以帮忙吗?谢谢。

I'm trying to build solr 4.0 snapshot in maven. Here are my steps:

  1. Check out solr in d:\workspace\solr
  2. download ant, unzip to d:\ant. set the ANT_HOME to d:\ant
  3. download maven-ant-tasks-2.1.3.jar (the latest version) to d:\ant\lib
  4. in commandline, go to d:\workspace\solr\lucene
  5. run command:
    ant generate-maven-artifacts

it gives the error:

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

I tried running:

ant -lib d:\ant\lib generate-maven-artifacts

it's the same error.

running ant alone will build solr without problem.

Environment setting:

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"

Can any one help? Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

楠木可依 2024-11-19 23:14:05

我认为你需要像这样运行 ant:

 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

I think you need to run ant like this:

 ant -lib d:\ant\lib\maven-ant-tasks-2.1.1.jar generate-maven-artifacts

Classpath adds need file references (not directory references). You can also add it like so:

 SET CLASSPATH=%CLASSPATH%;d:\ant\lib\maven-ant-tasks-2.1.1.jar
 ant generate-maven-artifacts
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文