Maven Internal Repository, Is it Really This Hard?

前端 未结 3 1829
没有蜡笔的小新
没有蜡笔的小新 2020-12-24 03:55

I have several projects which use Maven and I would like to run an internal repository on my work network. I have several libraries which are from third parties and cannot b

3条回答
  •  无人及你
    2020-12-24 04:50

    I have only worked with Nexus, but I found it very easy to install:

    1. Go to http://www.sonatype.org/nexus/go to download the OSS version
    2. Get the 'WAR' distribution
    3. Install the servlet in my installation of Tomcat, via the Web Application Manager

    At that point, I can visit http://myserver:8080/nexus to see everything working.

    For a superficial setup, I add the default password to my settings.xml:

        
                
                        my-snapshots
                        admin
                        admin123
                
                
                        my-releases
                        admin
                        admin123
                
        
    

    and in my POM file:

        
                
                        my-snapshots
                        My internal repository
                        http://myserver:8080/nexus/content/repositories/snapshots
                
                
                        my-releases
                        My internal repository
                        http://myserver:8080/nexus/content/repositories/releases
                
        
    

    To go beyond this, the learning curve jumps up quite a bit, but I found Sonatype's online books to be pretty good. Repository Management with Nexus is the one for understanding what you can do with the repository server. The only thing I found tricky is that some of the info applies only to their commercial software and they don't work too hard to advertise the difference.

提交回复
热议问题