Do you know the maven profile for mvnrepository.co

2019-01-21 06:33发布

I am trying to include some dependencies in my maven project. These dependencies are not available in the default Mven 2 repository http://repo1.maven.org/maven2/.

They are available at http://mvnrepository.com/

But I couldn't find the profile for this site to include in my settings.xml

Does anyone know what this repository's url and profile is?

Thanks.

4条回答
啃猪蹄的小仙女
2楼-- · 2019-01-21 06:52

You can put this configuration in your settings.xml file:

            <repository>
                <id>mvnrepository</id>
                <url>http://repo1.maven.org/maven2</url>
                <snapshots>
                    <enabled>false</enabled>
                </snapshots>
                <releases>
                    <enabled>true</enabled>
                </releases>
            </repository>
查看更多
一纸荒年 Trace。
3楼-- · 2019-01-21 06:55

Please use this profile

  <profiles>
    <profile>
        <repositories>
            <repository>
                <id>mvnrepository</id>
                <name>mvnrepository</name>
                <url>http://www.mvnrepository.com</url>
            </repository>
        </repositories>
    </profile>
  </profiles>
  <activeProfiles>
    <activeProfile>mvnrepository</activeProfile>
  </activeProfiles>
查看更多
倾城 Initia
4楼-- · 2019-01-21 07:06

mvnrepository.com isn't a repository. It's a search engine. It might or might not tell you what repository it found stuff in if it's not central; since you didn't post an example, I can't help you read the output.

查看更多
Deceive 欺骗
5楼-- · 2019-01-21 07:18

Once you've found your jar through mvnrepository.com, hover the "download (JAR)" link, and you'll see the link to the repository which contains your jar (you can probably Right clic and "Copy link URL" to get the URL, what ever your browser is).

Then, you have to add this repository to the repositories used by your project, in your pom.xml :

<project>
  ...
  <repositories>
    <repository>
      <id>my-alternate-repository</id>
      <url>http://myrepo.net/repo</url>
    </repository>
  </repositories>
  ...
</project>

EDIT : now MVNrepository.com has evolved : You can find the link to the repository in the "Repositories" section :

License

Categories

HomePage

Date

Files

Repositories

查看更多
登录 后发表回答