War plugin - classpath a file to WEB/INF/classes

I like to use the classpath in war plugin to have a file (not a jar or zip file) to be put under WEB-INF/classes. However, it is put in WEB-INF/lib. I know I can have the file put in tempoarary directory first and classpath that temporary directoy. But this seems inconvenient.

The classpath method always puts the assigned files in the WEB-INF/lib directory. If you want to put a file into another directory, you can use the following approach:

war {
    from('someDir') {
        include 'your-file.txt'
        into 'WEB-INF/classes'
    }
}

sorry to hijack this thread, but what if you have something like

war {
    from('src/main/java') {
        include '**/*.vm'
        into 'WEB-INF/classes'
    }
}

the into block doesn’t seem to do anything in this case

EDIT: got it working, the trick was to move “into” before include

1 Like