Build com Maven

Olá a todos !

Eu estou tentando utilizar o Maven para automatizar o processo de build aqui da empresa, mas, não entendo o que há de errado. O meu problema é para baixar as libs do Hibernate, isto porque eu estou recebendo uma mensagem do tipo Unable to find resource … mas o meu POM esta apontando justamente para o repo do Hibernate e eu consigo navegar normalmente neste repo pelo browser. Troquei as versões várias vezes mas eu não consigo baixar as dependências, para explicar melhor, segue abaixo o POM.


<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>
	<groupId>com.vero</groupId>
	<artifactId>Hiber</artifactId>
	<version>0.0.1-SNAPSHOT</version>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	</properties>

	<repositories>
		<repository>
			<id>JBoss Repository</id>
			<name>JBoss Repository</name>
			<url>http://repository.jboss.org/nexus/content/groups/public-jboss</url>
		</repository>
	</repositories>


	<dependencies>
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-core</artifactId>
			<version>3.5.6.Final</version>
		</dependency>
	</dependencies>


	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<configuration>
					<archive>
						<addMavenDescriptor>false</addMavenDescriptor>
						<manifest>
							<addClasspath>true</addClasspath>
							<classpathPrefix>lib/</classpathPrefix>
							<mainClass>org.component.launcher.Main</mainClass>
						</manifest>
					</archive>
				</configuration>
			</plugin>

			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>copy-dependencies</id>
						<phase>package</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<outputDirectory>${project.build.directory}/lib</outputDirectory>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</project>

OBS: Vale a pena ressalvar que tem um outro POM aqui com as dependências do Icefaces que roda normal, mesmo com o repo local .m2 vazio, então isto me leva a crer que não é um problema de conexão.

Vlw !!!

e ae ivan…

cara eu li esse tutorial para automatizar umas coisas aqi… tomara q ele te ajude…!

http://goo.gl/FqwGU

Para ver este link inteiro tem que comprar esta revista, mas vlw !!

oi,

você está usando alguma IDE para fazer o update das dependencias ou por linha de comando?

[]´s

André Fonseca, eu estou utilizando a linha de comando, eu uso o comando mvn clean install.

a versão do hibernate-core esta errada (3.5.6.Final).
a disponível no repositório é 3.5.6-Final

tolle, eu já troquei o “.” pelo “-” e não funcionou

executa o comando mvn clean install -e e coloca o saída, por favor.

Abs.

Segue abaixo o código com o erro…


D:\workspace2\TestesHibernate>mvn clean install -e
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - com.vero:Hiber:jar:0.0.1-SNAPSHOT
[INFO]    task-segment: [clean, install]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\workspace2\TestesHibernate\src\main\resources
Downloading: http://repo1.maven.org/maven2/org/hibernate/hibernate-core/3.5.6-Final/hibernate-core-3.5.6-Final.pom
[INFO] Unable to find resource 'org.hibernate:hibernate-core:pom:3.5.6-Final' in repository jboss-repo (https://repository.jboss.org/nexus/content/repositories/releases/)
Downloading: http://repo1.maven.org/maven2/org/hibernate/hibernate-core/3.5.6-Final/hibernate-core-3.5.6-Final.pom
[INFO] Unable to find resource 'org.hibernate:hibernate-core:pom:3.5.6-Final' in repository JBoss Repository (http://repository.jboss.org/nexus/content/groups/public-jboss)
Downloading: http://repo1.maven.org/maven2/org/hibernate/hibernate-core/3.5.6-Final/hibernate-core-3.5.6-Final.pom
[INFO] Unable to find resource 'org.hibernate:hibernate-core:pom:3.5.6-Final' in repository central (http://repo1.maven.org/maven2)
Downloading: http://repo1.maven.org/maven2/org/hibernate/hibernate-core/3.5.6-Final/hibernate-core-3.5.6-Final.jar
[INFO] Unable to find resource 'org.hibernate:hibernate-core:jar:3.5.6-Final' in repository jboss-repo (https://repository.jboss.org/nexus/content/repositories/releases/)
Downloading: http://repo1.maven.org/maven2/org/hibernate/hibernate-core/3.5.6-Final/hibernate-core-3.5.6-Final.jar
[INFO] Unable to find resource 'org.hibernate:hibernate-core:jar:3.5.6-Final' in repository JBoss Repository (http://repository.jboss.org/nexus/content/groups/public-jboss)
Downloading: http://repo1.maven.org/maven2/org/hibernate/hibernate-core/3.5.6-Final/hibernate-core-3.5.6-Final.jar
[INFO] Unable to find resource 'org.hibernate:hibernate-core:jar:3.5.6-Final' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) org.hibernate:hibernate-core:jar:3.5.6-Final

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=org.hibernate -DartifactId=hibernate-core -Dversion=3.5.6-Final -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=org.hibernate -DartifactId=hibernate-core -Dversion=3.5.6-Final -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
        1) com.vero:Hiber:jar:0.0.1-SNAPSHOT
        2) org.hibernate:hibernate-core:jar:3.5.6-Final

----------
1 required artifact is missing.

for artifact:
  com.vero:Hiber:jar:0.0.1-SNAPSHOT

from the specified remote repositories:
  remote-repos (http://repo1.maven.org/maven2)



[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Missing:
----------
1) org.hibernate:hibernate-core:jar:3.5.6-Final

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=org.hibernate -DartifactId=hibernate-core -Dversion=3.5.6-Final -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=org.hibernate -DartifactId=hibernate-core -Dversion=3.5.6-Final -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
        1) com.vero:Hiber:jar:0.0.1-SNAPSHOT
        2) org.hibernate:hibernate-core:jar:3.5.6-Final

----------
1 required artifact is missing.

for artifact:
  com.vero:Hiber:jar:0.0.1-SNAPSHOT

from the specified remote repositories:
  remote-repos (http://repo1.maven.org/maven2)


        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:711)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.artifact.resolver.MultipleArtifactsNotFoundException: Missing:
----------
1) org.hibernate:hibernate-core:jar:3.5.6-Final

  Try downloading the file manually from the project website.

  Then, install it using the command:
      mvn install:install-file -DgroupId=org.hibernate -DartifactId=hibernate-core -Dversion=3.5.6-Final -Dpackaging=jar -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file there:
      mvn deploy:deploy-file -DgroupId=org.hibernate -DartifactId=hibernate-core -Dversion=3.5.6-Final -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
        1) com.vero:Hiber:jar:0.0.1-SNAPSHOT
        2) org.hibernate:hibernate-core:jar:3.5.6-Final

----------
1 required artifact is missing.

for artifact:
  com.vero:Hiber:jar:0.0.1-SNAPSHOT

from the specified remote repositories:
  remote-repos (http://repo1.maven.org/maven2)


        at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:360)
        at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolveTransitively(DefaultArtifactResolver.java:304)
        at org.apache.maven.plugin.DefaultPluginManager.resolveTransitiveDependencies(DefaultPluginManager.java:1499)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:442)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        ... 17 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3 seconds
[INFO] Finished at: Thu Feb 03 11:29:48 BRST 2011
[INFO] Final Memory: 8M/19M
[INFO] ------------------------------------------------------------------------
D:\workspace2\TestesHibernate>

oi,

por favor, veja como estão declaradas as dependências do hibernate

uma outra alternativa é você fazer o download manualmente e depois fazer o install conforme está sendo mostrado na mensagem

abs

André Fonseca, onde eu vejo as dependencias declaradas pelo Hibernate ?