Having problem creating maven artifacts in solr on Windows 7
I'm trying to build solr 4.0 snapshot in maven. Here are my steps:
- Check out solr in d:\workspace\solr
- download ant, unzip to d:\ant. set the ANT_HOME to d:\ant
- download maven-ant-tasks-2.1.3.jar (the latest version) to d:\ant\lib
- in commandline, go to d:\workspace\solr\lucene
- 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 he开发者_如何学编程lp? Thanks.
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
精彩评论