1

I have a Gradle Project, and I need add to the catalina.properties file:

org.apache.catalina.startup.ContextConfig.jarsToSkip=bcprov*.jar

But I don't know where I can find this file in my gradle project.

  • can you provide more details about your project? is it Spring Boot or standard Web App ? are you deploying on embedded or existing Tomcat container ? – M.Ricciuti Oct 06 '18 at 06:57
  • It's spring project, and I start my application using gradle tasks, I run `gradle tomcatStart`. – Gabriela Silva Oct 06 '18 at 17:55
  • it seems you are using gradle-tomcat plugin: maybe this answer can help you configure the properties file : https://stackoverflow.com/a/15069636/6899896 – M.Ricciuti Oct 06 '18 at 18:19

1 Answers1

0

It's not clear if you are using gradle-tomcat plugin or not, but if you are: you could create a task that copy the catalina.propetiesconfig file to the temporary Tomcat directory, and make the tomcatRun depends on this task. The catalina.properties file could be stored in your project resources , e.g.: in src/main/conf

ext{
    // path to catalina.properties in your project
    catalinaPropertiesPath = 'src/main/conf/catalina.properties'

    // path to temporary directory used by gradle-tomcat plugin
    tomcatTmpRunDir = "$buildDir/tmp/tomcatRun/conf"
}

// copy catalina.properties conf file
task copyCatalinaProperties(type: Copy){
    from( catalinaPropertiesPath)
    into(tomcatTmpRunDir)

}

// create task dependency
tomcatRun.dependsOn copyCatalinaProperties

( based on solution given here : https://stackoverflow.com/a/15069636/6899896 )

M.Ricciuti
  • 11,070
  • 2
  • 34
  • 54
  • I think this will help me, I'll try it. thanks. And my build.gradle: https://gist.github.com/I-am-Gabi/45201a70b855226be660b24c6ccc4f6b, Should I create the task dependency in my build.gradle? – Gabriela Silva Oct 06 '18 at 19:07
  • Hey! Thank you! It's working. I made a little change: https://gist.github.com/I-am-Gabi/779ad0d6d7715d93e9c29e4499e54130 – Gabriela Silva Oct 06 '18 at 19:18