服务器连接私库的maven配置



${user.home}/workspace/env/maven/repository


true


false




    
    





    
        
        server_id

        
        auth_username

        
        auth_pwd

        
        path/to/private_key

        
        some_passphrase

        
        664

        
        775

        
        

    




     
    

        
        sjtugmaven

        
        sjtug maven proxy

        
        https://mirrors.sjtug.sjtu.edu.cn/maven-central/
        
        central
    






    
    

        
        example_proxy

        
        false

        
        https

        
        proxy.molo.com

        
        443

        
        proxy_user

        
        proxy_pwd

        
        *.google.com|ibiblio.org

    






    

        
        profile_id

        
        

            
            false

            
            9.9

            
            

                
                Windows XP

                
                Windows

                
                x86

                
                5.1.2600

            

            
            

                
                mavenVersion

                
                2.0.3

            
            
            
            

                
                /path/to/active_on_exists

                
                /path/to/active_on_missing

            

        
        
        

            
            this.property.is.accessible.when.current.profile.actived

        

        
        
            

            
            

                
                maven_repository_id

                
                maven_repository_name

                
                http://host/maven

                
                default

                
                

                    
                    false

                    
                    always

                    
                    warn

                

                
                
                    
                    
                    
                

            

            

        

        
        

    





自己项目在服务器上的配置
配置的是私库的地址,这样服务器就从私库上下载jar包
在root/.m2/settings.xml里面的配置优先级最高。

<?xml version="1.0" encoding="UTF-8"?>

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

    <profiles>
        <profile>
            <id>development</id>
            <pluginRepositories>
                <pluginRepository>
                    <id>central</id>
                    <name>yunji-public</name>
                    <url>http://nexus.XXXXXXXXXXX/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                    <layout>default</layout>
                </pluginRepository>
            </pluginRepositories>
            <repositories>
                <repository>
                    <id>central</id>
                    <url>http://nexus.XXXXXXXXXXX</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
                <repository>
                    <id>central2</id>
                    <name>Maven Repository Switchboard</name>
                    <layout>default</layout>
                    <url>http://repo1.maven.org/maven2</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
            </repositories>
        </profile>
    </profiles>
    <activeProfiles>
        <activeProfile>development</activeProfile>
    </activeProfiles>
</settings>

参考感谢:https://www.cnblogs.com/iceJava/p/10356309.html

你可能感兴趣的:(服务器配置)