How to convert file separator in maven

前端 未结 2 714
执笔经年
执笔经年 2021-02-08 22:15

I have a property defined like this:


    ${project.parent.basedir}

2条回答
  •  忘了有多久
    2021-02-08 23:00

    I don't think there is a non-programmatical way to do that. So I suggest a groovy one-liner with the Maven GMaven plugin (GMaven is usually the simplest way to embed programmatic code into a pom):

    
        org.codehaus.gmaven
        gmaven-plugin
        
            
                setproperty
                validate
                
                    execute
                
                
                    
    pom.properties['main.basedir']=project.parent.basedir.absolutePath.replace('\\','/');
                    
                
            
        
    
    

提交回复
热议问题