Results 1 to 3 of 3

Thread: Resource Files are not picked up on Gradle Based projects

  1. #1
    Join Date
    Jan 2011
    Posts
    20

    Default Resource Files are not picked up on Gradle Based projects

    When STS creates a .classpath file on a Gradle project, the following entries are created (in the following order),
    <classpathentry excluding="**" kind="src" output="build/resources/main" path="src/main/resources"/>
    <!-- Additional entries skipped -->
    <classpathentry excluding="**" kind="src" output="build/resources/test" path="src/test/resources"/>

    Impact:
    1) All actual resources (such as XML & .properties files) are excluded from the build and are unavailable for tests
    2) Resource files in Test could be overridden by resource files in the main path.

    Version of STS: 2.9.1.

    Should I open an issue in JIRA?

  2. #2
    Join Date
    Jan 2011
    Posts
    20

    Default

    Forgot to add the workaround!
    Modify the .classpath file as follows:
    1) move the src/test/resources in front of the src/main/resources element.
    2) Remove the 'excluding="**"' from both resource elements.

  3. #3
    Join Date
    May 2010
    Posts
    398

    Default

    Sorry for the late reply.

    > Should I open an issue in JIRA?

    Probably. It is possibly a bug in STS gradle support.

    Since there are a bunch of different ways to create / import projects into STS (e.g. many options in the import wizard), it is important to provide some very precise instructions on how to reproduce the problem. Ideally, provide a small sample project and exact step-by-step instructions on how to get this project into the workspace so that the problem happens.

    If you think you are able and willing to provide this amount of detail... Please *do* raise a Jira issue and I will be happy to track down the origin of the problem and fix it if is is indeed an STS problem.

    Kris
    Kris De Volder -- SpringSource

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •