Building a runnable jar with Maven 2

前端 未结 5 792
猫巷女王i
猫巷女王i 2020-11-28 18:31

I\'m relatively new to the Maven mantra, but I\'m trying to build a command-line runnable jar with Maven. I\'ve setup my dependencies, but when I run mvn install

5条回答
  •  臣服心动
    2020-11-28 19:23

    I Agree with Joachim Sauer,

    Instead of using jar-with-dependency you should configure the jar plugin like that in your pom.xml:

    
        org.apache.maven.plugins
        maven-jar-plugin
        2.4
        
            
                true
                
                    true
                    [mainClassFullName]
                
                
                    development
                    ${project.url}
                    value
                
            
        
    
    

    And use this assembly configuration to add the jar dependencies to you assembly:

    
      zip-with-jars
      
        zip
      
      false
      
        
        
        /
        true
        false
        runtime
        
    
      
    
    

提交回复
热议问题