开发者

Why doesn't my maven build get the jar from my repository?

I'm trying to set up Maven repository for some jar files from vendors and from classes I wrote.

It's working for the oracle jar files I put in, but not for my own jar.

I set up an apache webserver to act as the mvn repository. I set the directories to show the index of files ( Options Indexes ).

Here's what the snippet from my root pom.xml

  <repositories>
    <repository>
      <id>mycompany-external-repo</id>
      <url>http://svn.mycompany.com/mvn</url>
    </repository>
  </repositories>

Here's the snippet for one project's pom.xml with the dependencies

    <dependency>
        <groupId>com.oracle.aq</groupId>
        <artifactId>aqapi</artifactId>
        <version>10.2.0.1.0</version>
    </dependency>

    <dependency>
        <groupId>com.mydomain</groupId>
        <artifactId>middleware</artifactId> 
        <version>1.0</version>
    </dependency>       

The URLs of the mvn repository are like so:

http://svn.mycompany.com/mvn/com/oracle/aq/aqapi/10.2.0.1.0/aqapi-10.2.0.1.0.jar 开发者_运维知识库   

http://svn.mycompany.com/mvn/com/mydomain/middleware/1.0/middleware-1.0.jar

What am I doing wrong with my jar file?

Here is the result of the mvn install

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building core 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://svn.mycompany.com/mvn/com/mydomain/middleware/1.0/middleware-1.0.pom
Downloading: http://repo1.maven.org/maven2/com/mydomain/middleware/1.0/middleware-1.0.pom
[WARNING] The POM for com.mydomain:middleware:jar:1.0 is missing, no dependency information available


Maven first looks for pom's at the expected location of the repo, before it will look for any other artifacts, without it, it cannot fetch them because it will not know how to deal with any dependencies for the artifact.

This is why it might be better to use something like Artifactory, which has a full featured open source edition. Artifactory will automatically generate pom info for you when you deploy your artifact and knows how to manage your deployment attempts. And, well, it will just do a whole lot more than just providing a site for your artifacts.


you have to setup a mirror, i assume you're using maven 2 or 3:

<mirror>
      <id>server_id</id>
      <name>Maven Repository running in your company</name>
      <url>http://svn.mycompany.com/mvn/</url>
      <mirrorOf>*</mirrorOf>
</mirror>     
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜