Is there a way to make Maven download snapshot versions automatically?

前端 未结 7 763
灰色年华
灰色年华 2021-02-05 08:27

So I have a project that depends on a snapshot version of another project. The dependency is:


  org.oop
  

        
7条回答
  •  我在风中等你
    2021-02-05 08:54

    To update snapshots, try with the -U option

    -U,--update-snapshots                  Forces a check for updated
                                           releases and snapshots on remote
                                           repositories
    

    However, you said:

    I did do a 'mvn clean deploy', so the snapshot version should be somewhere in the maven central repository.

    This is just not possible, your snapshot is going somewhere else. If I do a mvn clean deploy without configuring my personal repository I get:

    Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter

    To enable deployment, there is some configuration to be added to pom.xml, like for instance:

    
    
        
        
            myrepo
            My releases
            http://nexus.mycompany.com/nexus/content/repositories/releases
        
    
        
        
            myrepo
            my snapshots
            http://nexus.mycompany.com/nexus/content/repositories/snapshots
        
    
    
    
    
        
            myrepo
            My Public Repository
            http://nexus.mycompany.com/nexus/content/groups/public
            
                true
            
            
                true
            
        
    
    

提交回复
热议问题