4

We have a Java project that was modified about 2 years ago based on the dates. The project uses a the Play Framework which as I recalled built and ran just fine back in 2012. The developer apparently had tried to change the project to be a Maven project but the folder structure is all over the place and not within the Maven src folder structure. Attempting to run the Play commands does not work on building the project any longer and using the Maven commands does not compile the code. What occurs is just the packaging of all of the folders and source code into a .jar file.

So the question is 'Can files outside of the Maven folder structure get compiled?' if so how, OR do I need to restructure all the code to be placed into the proper Maven folder structure to try and get this to work again?

Thanks for your time.

Rough view of the folder tree below: Unable to post the POM as it is on another system


  • Project Name
    • src
      • main/java/
    • trunk
      • Project Name
        • ... play framework folder structure in here eclipse, modules, precompiled, tmp
        • conf
        • lib
    • Web Content
      • META-INF
      • WEB-INF
edjm
  • 4,830
  • 7
  • 36
  • 65
  • 1
    Could you post your current POM, folder structure and which files in this structure you wish to compile? – Tunaki Oct 14 '15 at 11:55
  • You can always include files from outside the traditional Maven structure into your build process BUT I would not recommend it. Can you provide your actual file structure ? – Gaël J Oct 14 '15 at 11:55

1 Answers1

3

Yes you can compile files in a non-standard Maven folder structure. Maven natively supports multiple source directories for the purposes of generated sources.

Read the Maven use guide When You Can't Use the Conventions

Using Multiple Source Directories This occurs when you are producing a single JAR (or other artifact), and have several source directories with classes you want to include.

This answer shows how to edit the directory structure in Maven by specifying the appropriate properties to override from the superpom.

The Maven pom docs show the build element set mentioned in the link above.

As a side note this answer covers a non standard directory layout for building war.

Community
  • 1
  • 1
Laurentiu L.
  • 6,566
  • 1
  • 34
  • 60
  • 1
    Thanks Laurentiu, this information looks like it will put us on the right path to fix the build. Greatly appreciate everybody's input. – edjm Oct 14 '15 at 12:53