利用assembly.xml打包maven项目报错

 

问题现象

使用以下assembly.xml打包时报Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2.1:single (make-assembly) on project south-interface: Failed to create assembly: Error creating assembly archive release: Failed to retrieve numeric file attributes using: '/bin/sh -c ls -1nlaR /'的错误


    release
    
        zip
    
    
        
        
            target
            
                *.jar
            
            /
        
        
            target/lib
            /lib
        
        
            target/config
            /config
        

        
        
            /
            
                *.sh
                *.bat
            
            /
        
    

原因分析

原因是识别不了文件目录"/"

解决方法

需要把directory和outputDirectory开头的"/"去掉,改成下面的形式打包就可以了


    release
    
        zip
    
    
        
        
            target
            
                *.jar
            
            
        
        
            target/lib
            lib
        
        
            target/config
            config
        

        
        
            
            
                *.sh
                *.bat
            
            
        
    

 

你可能感兴趣的:(java,maven,assembly,maven,打包)