开发者

Unable to add repositories to local settings.xml

I'm having trouble getting Maven to download dependencies when I specify my repositories in my .m2/settings.xml file. However, Maven downloads these dependencies when I add the repository names to my pom.

Specifically, I am attempting to compile some hibernate example projects, and I've read in the instructions that I should add the following repositories to either my pom or settings.xml:

    <repositories>
        <repository>
          <id>jboss-public-repository-group</id>
          <name>JBoss Public Repository Group</name>
          <url>http://repository.jboss.org/nexus/content/groups/public/</url>
          <layout>default&开发者_StackOverflowlt;/layout>
          <releases><enabled>true</enabled><updatePolicy>never</updatePolicy></releases>
          <snapshots><enabled>true</enabled><updatePolicy>never</updatePolicy></snapshots>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>jboss-public-repository-group</id>
            <name>JBoss Public Repository Group</name>
            <url>http://repository.jboss.org/nexus/content/groups/public/</url>
            <releases><enabled>true</enabled></releases>
            <snapshots><enabled>true</enabled></snapshots>
        </pluginRepository>
        </pluginRepositories>    

Everything works fine when I put the snippet in my project's pom.xml, but when I try putting it in settings.xml I receive this error:

The POM for org.hibernate:hibernate-core:jar:3.6.1.Final is missing, no dependency information available

Any ideas what I may be doing wrong?


You must have specified <repositories> and <pluginRepositories> within <profile> tag of settings.xml. Possibly this profile is not active. Ensure one of the below is present in your settings file.

<activeProfiles>
    <activeProfile>myProfile</activeProfile>
</activeProfiles>

or

<profile>
   <id>myProfile</id>
   <activation>
      <activeByDefault>true</activeByDefault>
   </activation>
   ...   
</profile>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜