Possible to change where Maven builds war from?
posted 14 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
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
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
posted 14 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
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.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
posted 14 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
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.
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 |











