Maven项目模块通过设置pom文件打可执行jar

 pom内容:



    
        ra
        com.xdja.pki
        0.0.1-SNAPSHOT
    
    4.0.0

    ra-sdk
    
    1.0.5-Alpha

    
        
        
            log4j
            log4j
            1.2.17
        
        
            com.alibaba
            fastjson
            1.2.9
        
        
            org.apache.commons
            commons-lang3
            3.4
        
        
            com.xdja.pki.gmssl
            gmssl-https
            1.0.4-SNAPSHOT
        
        
            com.xdja.pki.gmssl
            gmssl-pki-utils
            1.0.4-SNAPSHOT
        
        
            com.fasterxml.jackson.core
            jackson-annotations
        
        
            com.fasterxml.jackson.core
            jackson-core
        
        
            com.fasterxml.jackson.core
            jackson-databind
        
        
            junit
            junit
            4.12
        
        
            commons-logging
            commons-logging
            1.2
        
        
        
            org.apache.httpcomponents
            httpclient
            4.5.3
        
    


    
        
        
            xdja-yycpb
            http://maven.xdja.com:8081/nexus3/repository/releases/
        
        
            xdja-yycpb-snapshots
            http://maven.xdja.com:8081/nexus3/repository/snapshots/
        
    

    

        
            
                org.apache.maven.plugins
                maven-compiler-plugin
               
                3.1
                
                    ${java.version}
                    ${java.version}
                    true
                    UTF-8
                
            
            
                org.apache.maven.plugins
                maven-jar-plugin
                
                3.1.0
                
                    
                        
                            
                            false
                            lib/
                        
                    
                
            
            
                org.apache.maven.plugins
                maven-dependency-plugin
                
                3.1.1
                
                    
                        copy-dependencies
                        package
                        
                            copy-dependencies
                        
                        
                            ${project.build.directory}/lib
                        
                    
                
            

            
                org.apache.maven.plugins
                maven-resources-plugin
                2.6
            
            
                org.apache.maven.plugins
                maven-release-plugin
                2.4.1
            
            
            
                org.apache.maven.plugins
                maven-surefire-plugin
                
                    true
                
            
            
            
                org.apache.maven.plugins
                maven-deploy-plugin
                2.7
                
                    true
                
            
            
            
                org.apache.maven.plugins
                maven-source-plugin
                2.2.1
                
                    
                        attach-sources
                        
                            jar-no-fork
                        
                    
                
            
        
    

其中上传到nexus服务器的id设置来源 settings的

Maven项目模块通过设置pom文件打可执行jar_第1张图片

打包:Maven-->待打包模块下的 install / deploy 控制台显示成功(BUILD SUCCESS)即可,

Maven项目模块通过设置pom文件打可执行jar_第2张图片

打开项目模块路径:

Maven项目模块通过设置pom文件打可执行jar_第3张图片

其中lib文件夹中为ra-sdk-1.0.5-Alpha.jar所依赖的jar,在使用ra-sdk-1.0.5-Alpha.jar时需要同时在同级目录引用lib下的jar包,也可以打jar时设置不同级目录。

 

你可能感兴趣的:(学习笔记)