Adding JBoss repository to m2eclipse, no latest Hibernate version

和自甴很熟 提交于 2020-01-05 08:26:23

问题


I'm trying to add JBoss repository to m2eclipse, mainly for Hibernate. It seems to work, but it can't find the latest version of Hibernate (3.5.1), only 3.5.0beta. I looked at some other packages, and they all seem a couple of months behind. What could be causing this? I'm running latest m2eclipse, and i guess latest Eclipse (it just says 20100218-1602, eclipse people think it's funny to not include version in the about dialog), on ubuntu 9.10.

This is my settings.xml

<settings>
<profiles>
    <profile>
        <id>jboss-maven2-release-repository</id>
        <activation>
            <activeByDefault>true</activeByDefault>
        </activation>

        <repositories>
            <repository>
                <id>jboss-maven2-release-repository</id>
                <url>http://repository.jboss.org/maven2</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </repository>
            <repository>
                <id>jboss-snapshots</id>
                <url>http://snapshots.jboss.org/maven2</url>
                <releases>
                    <enabled>false</enabled>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </repository>
        </repositories>
        <pluginRepositories>
            <pluginRepository>
                <id>jboss-releases</id>
                <url>http://repository.jboss.org/maven2</url>
                <releases>
                    <enabled>true</enabled>
                </releases>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
            </pluginRepository>
            <pluginRepository>
                <id>jboss-snapshots</id>
                <url>http://snapshots.jboss.org/maven2</url>
                <releases>
                    <enabled>false</enabled>
                </releases>
                <snapshots>
                    <enabled>true</enabled>
                </snapshots>
            </pluginRepository>
        </pluginRepositories>
    </profile>
</profiles>


回答1:


Thank you Pascal, but I just figured out what the problem was. JBoss recently switched to nexus, and is no longer updating the old repo (http://repository.jboss.org/maven2)

You can find the new list of repositories here:

https://repository.jboss.org/nexus/index.html#view-repositories

They work fine with m2eclipse (everything is up to date)

Anyways, great job announcing this, JBoss, I just spent 5 hours googling to find the new repo :(




回答2:


The nexus index is very likely out of date, just add the dependency manually:

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

I wouldn't use a profile but simply add the repository to the pom BTW (but this is a personal choice):

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


来源:https://stackoverflow.com/questions/2678892/adding-jboss-repository-to-m2eclipse-no-latest-hibernate-version

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!