Removing version number from file name with Maven

前端 未结 3 1505
小蘑菇
小蘑菇 2021-02-03 17:49

I have a project with 5 modules in maven. Right now, when I do a \"mvn clean install\", it generates an ear containing the two jars, one war and one sar from the other modules.<

3条回答
  •  心在旅途
    2021-02-03 18:40

    In your ear module, you can either use the project.build.finalName element or you can configure the maven-ear-plugin which supports a finalName optional parameter. And to configure the final name of a bundled jar, you'll need to define a jarModule and to set the bundleFileName property for it.

    The final configuration might looks something like that (I'll demonstrate how to set the the final ear name in the plugin configuration here):

    
      [...]
      
        
          yourgroupid
          projectx-client
          2.0.0
        
        [...]
      
      [...]  
      
        [...]
        
          [...]
          
            maven-ear-plugin
            2.4
            
              projectx-ear
              
                
                  yourgroupid
                  projectx-client
                  anotherName.jar
                
              
            
          
          [...]
    
    

提交回复
热议问题