Files got overwritten in maven project when building a war

后端 未结 4 1778
时光取名叫无心
时光取名叫无心 2020-12-04 02:20

I\'m building a web application project using maven, and packaging is set to \"war\". I also use YUI compressor plugin to compress javascript codes in the webapp directory.

4条回答
  •  北海茫月
    2020-12-04 02:42

    I think @user944849 answer is the correct answer, at least one of the correct answers. Another way of archiving this is to exclude the modified javascript directory from maven-war-plugin configuration, e.g.:

    
         maven-war-plugin 
        
            **/external/ dojo/**/*.js 
        
    
    

    this will tell maven-war-plugin not to copy from the excluded directory, but since the modified javascript directory is already there, the war file still contains the javascript directory, BUT with the modified, in this case, compressed javascript codes.

提交回复
热议问题