Copy dependency of a maven project to specific folder

前端 未结 1 1703
暗喜
暗喜 2021-02-15 11:11

I am trying to get all the jar required for a maven project inside a particular folder.

I have used mvn dependency:copy-dependencies command.

It giv

1条回答
  •  太阳男子
    2021-02-15 11:56

    You need to use the outputDirectory property to define the required location where you would like the jars to be copied to.

    Here is an example of the configuration you would add in your POM:

    
    ...
        
            org.apache.maven.plugins
            maven-dependency-plugin
            
                
                    copy-dependencies
                    package
                    
                        copy-dependencies
                    
                    
                        ${project.build.directory}/alternateLocation
                    
                
            
        
        ...
    
    

    Alternatively you can pass this configuration directly via the command line:

    mvn -DoutputDirectory=alternativeLocation dependency:copy-dependencies 
    

    0 讨论(0)
提交回复
热议问题