Are you behind a web proxy? If so, I belive you need to configure this. I don't personally build Maven with ant, so I don't know how but there should be a clue somewhere (maybe in build.xml?).
The http://repo1.maven.org/maven2 repo is fine. That's not the problem here. /Anders On Tue, Jan 22, 2013 at 6:25 AM, Shixiang Wen <[email protected]>wrote: > Hi, > > I tried to build maven 3.0.4 by following commands: > > set M2_HOME=C:\Data\wengm\workspace\maven-3.0.4-SNAPSHOT > > set PATH=%M2_HOME%;%PATH% > > ant > > However, I failed with following error: > > C:\Data\wengm\workspace\apache-maven-3.0.4>ant > Buildfile: C:\Data\wengm\workspace\apache-maven-3.0.4\build.xml > > clean-bootstrap: > > initTaskDefs: > [echo] Building Apache Maven ... > > isMavenHomeSet: > > init: > [echo] maven.home = C:\Data\wengm\workspace\maven-3.0.4-SNAPSHOT > [echo] maven.repo.local = C:\Users\egugwen/.m2/repository > [echo] distributionId = apache-maven > [echo] distributionName = Apache Maven > [echo] distributionDirectory = apache-maven > > prompt-maven-home-exists: > [input] WARNING: > [input] The specified target directory > [input] C:\Data\wengm\workspace\maven-3.0.4-SNAPSHOT > [input] already exists. It will be deleted and overwritten by the > build. > [input] Do you want to continue? (yes, [no]) > yes > > pull: > [artifact:pom] Downloading: > org/apache/maven/maven-parent/21/maven-parent-21.pom from repository > central at http://repo1.maven.org/maven2 > [artifact:pom] Error transferring file: Connection timed out: connect > [artifact:pom] [WARNING] Unable to get resource > 'org.apache.maven:maven-parent:pom:21' from repository central ( > http://repo1.maven.org/maven2): Error transferring file: > Connection timed out: connect > [artifact:pom] An error has occurred while processing the Maven artifact > tasks. > [artifact:pom] Diagnosis: > [artifact:pom] > [artifact:pom] Unable to initialize POM dependencies.xml: Cannot find > parent: org.apache.maven:maven-parent for project: null:maven:pom:3.0.4 for > project null:maven:pom > :3.0.4 > [artifact:pom] Unable to download the artifact from any repository > [artifact:pom] > > BUILD FAILED > C:\Data\wengm\workspace\apache-maven-3.0.4\build.xml:105: Unable to > initialize POM dependencies.xml: Cannot find parent: > org.apache.maven:maven-parent for project: null > :maven:pom:3.0.4 for project null:maven:pom:3.0.4 > > Total time: 44 seconds > > Then, I tried to access http://repo1.maven.org/maven2 and it told me: > > Browsing for this directory has been disabled. > View this directory's contents on http://search.maven.org instead. > > So, could you please: > * change the default remote repository URL from > http://repo1.maven.org/maven2 to something else? > * tell user like me to configure the remote repository URL? > Look forward to your response! Thanks! > > Bruce Wen(GuangMing)
