• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Devaka Cooray
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

Possible to change where Maven builds war from?

 
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm using Maven 3.0.3. I have an SCM plugin (v 1.5) that checks out a version of my code to the target/checkout directory. I would like to build my WAR from there, but I can't figure out how to do it. Any ideas? For what it's worth, I'm using Git 1.7.4.1.

Thanks, - Dave
 
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From the maven faq:

Is it possible to create my own directory structure?

Absolutely yes!

By configuring <sourceDirectory>, <resources> and other elements of the <build> section.

In addition, you may need to change the plugin configuration if you are not using plugin defaults for their files/directories.

 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dave, if I understand you correctly, you have a pom.xml that have the scm plugin configured and you run mvn with that pom.xml to extract the projects contents from the repository. And now you would like to know how to get mvn to finish the job by doing the rest of the build. Is that correct? (I hope so, otherwise the rest of my response will make no sense.)

You have a chicken-and-egg problem here. The pom.xml should really be in the source control system along with the rest of the project's files. So you actually have to pull one of the files (pom.xml) out of source control before you can even get started.

One of the possibilities is to configure the scm plugin to run as part of one of the early build lifecycle phases, such as generate-sources. Note that you would do this within the same pom.xml used to build the WAR. Your steps would then be to first extract the pom.xml file source control and then run Maven.

But I think that a better mechanism is to use a continuous integration system such as Jenkins (aka Hudson) to manage the build. When you configure Jenkins to build something, you tell it where to grab the source from version control and what tool to use to build it (e.g., Ant, Maven, etc). Jenkins then does all the rest.
 
I suggest huckleberry pie. But the only thing on the gluten free menu is this tiny ad:
Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders
https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing
reply
    Bookmark Topic Watch Topic
  • New Topic