How to configure custom maven project structure

I know that typically maven structure is like this:

   - main
   - web
    - WEB-INF

However, I have a project which has the following structure

  • Variable from a property file used in email trigger script in JENKINS
  • How do I avoid issues with “Protected Mode” using IEDriverServer in Selenium?
  • Jenkins copy directories/files in a build
  • maven Error resolving version for plugin maven-eclipse-plugin in Jenkins
  • Jenkins drop down list of build names of other job
  • ANT checkout task fails
  • src
      - main
      - WEB-INF

    The latter of the two above currently does not use maven. I’ve started using maven for this project locally by making the structure conform to the maven standard. However, I now want to automatically build this project from jenkins by getting it out of the source control (svn). So I would like to just add a pom.xml which is aware of the fact that web isn’t inside src

    Is this possible to do with maven?

  • How to have a Jenkins build step that downloads a URL?
  • Jenkins Publish over ssh authentification failed with private key
  • Cannot load JDBC driver class 'com.mysql.jdbc.Driver' sonar plugin jenkins
  • How to debug android project from git using Jenkins frontend?
  • Jenkins on Openshift cannot clone repo
  • How to include a maven module outside of the project context?
  • 2 Solutions collect form web for “How to configure custom maven project structure”

    You can configure the maven-war-plugin to use another warSourceDirectory but as Jeff Storey explains in his answer it is really not recommended.

    This is how you would do it:


    One of several problems is for example that the maven-jetty-plugin will not run out-of-the-box. It will by default look in src/main/webapp so that has to be configured.

    You might not use the maven-jetty-plugin but you get the idea.

    Using the maven war plugin properties, you can set the warSourceDirectory property (I’m not sure exactly what problems you’re having, so this may or may not solve your specific problem).

    However, maven is very opinionated and I would strongly recommend using the expected maven structure. Other plugins may give you unexpected problems down the road, and maven life is generally a lot easier when you follow their conventions.

    Git Baby is a git and github fan, let's start git clone.