I don't have acces to the files right now (i don't have my laptop with me), but I am not sure it matters what they contain because the command 'mvn -f otherPom.xml deploy' works fine (it builds the project in the correct way), so the package phase works, but when it reaches the install phase it is trying to install pom.xml in .m2, not otherPom.xml like it should.
I cannot test right now, but it can be tested very simple: in a simple project, rename pom.xml and run install/deploy, and see if it works. If it is ok, then is smth that I've done wrong. Else maybe it is the desired effect (wich I don't understand). Thank you for your patience :) On Monday, August 10, 2015, Sander Verhagen <san...@sanderverhagen.net> wrote: > Hi, > > > > > > I think you're being treated unfairly ;-) > > > > Yes, it's not the Maven way, but you have acknowledged that. But sometimes > projects are the way they are. I do my best to deliver nice Maven projects, > but I have one project also where the sources are so intertwined that I > cannot possibly split them up. This is a documentation project, and its > "sources", from Maven's perspective, are generated for me (not just once), > so refactoring these sources is out of my hands. I wish it were different, > but for now this is what it is, and I've decided that for me this is still > a valid use case for Maven. So, give the guy a break ;-) > > > > By the way, I think the discussion mixes up artifacts and folders. Yes, > the POM uniquely describes an artifact, no argument there. It does not > constitute exclusive ownership of a folder – in my humble opinion. > > > > That all being said: it's working for me. We deploy and release these > modules, and these are the POM files: > > · pom.xml // parent the following modules > > · pom-onpremises.xml // parent.relativePath=./pom.xml > > · pom-hosted.xml > > > > I don’t think I did much out of the ordinary to make this setup work. I > feel it’s pretty much the same as what you’re doing. So, at this point we > start dissecting POM files? > > > > Sander. > > > Sander Verhagen > [ san...@sanderverhagen.net <javascript:;><mailto: > san...@sanderverhagen.net <javascript:;>> ] > > NOTICE: my e-mail address has changed. Please remove verha...@sander.com > <mailto:verha...@sander.com <javascript:;>> now and start using > san...@sanderverhagen.net<mailto:san...@sanderverhagen.net <javascript:;>> > from now on. Please update your address book. Thank you! > > > > > -----Original Message----- > > > From: Alex Ditu [mailto:ditu.alexan...@gmail.com <javascript:;>] > > > Sent: Monday, August 10, 2015 8:17 > > > To: Maven Users List > > > Subject: Re: Use 2 pom.xml files with different names > > > > > > So the answer is: one cannot use a pom file with a different name than > > > 'pom.xml'. > > > > > > In such case, why the -f option exists? > > > On Aug 10, 2015 6:13 PM, "Benson Margulies" <bimargul...@gmail.com > <javascript:;><mailto:bimargul...@gmail.com <javascript:;>>> > > > wrote: > > > > > > > On Mon, Aug 10, 2015 at 11:04 AM, Alex Ditu > > > <ditu.alexan...@gmail.com <javascript:;><mailto:ditu.alexan...@gmail.com > <javascript:;>>> > > > > wrote: > > > > > I know how to solve my problem (by changing the project > configuration). > > > > > > > > > > My question is: why mvn -f otherPomName.xml deploy doesen't work? > > > > > And I said above how it fails. > > > > > > > > It does not _fail_. It does precisely what it is designed to do. > > > > > > > > mvn -f says, 'read the model of this project from an alternative > > > > location, and then do what you do.' > > > > > > > > Once Maven has read the XML, it has no idea where the file came from, > > > > and it's not supposed to have any idea where the file came from. > > > > Maven's job is to do the build as specified by the POM abstract data > > > > model. That makes no provisions for your scheme. > > > > > > > > > > > > > > > > > On Aug 10, 2015 5:59 PM, "Barrie Treloar" <baerr...@gmail.com > <javascript:;><mailto:baerr...@gmail.com <javascript:;>>> wrote: > > > > > > > > > >> On 10 August 2015 at 23:22, Alex Ditu <ditu.alexan...@gmail.com > <javascript:;><mailto:ditu.alexan...@gmail.com <javascript:;>>> > > > wrote: > > > > >> > > > > >> > Ok, look what I am trying to achieve: I have a project with 2 > > > > >> > profileDeployments (it produces 2 types of artifacts: a jar and a > > > > >> > war) but from the same sources. So, I did the following thing: I > > > > >> > have written 2 pom.xml files with 2 different names (for example: > > > > >> > pom.xml and pom2.xml). When I want to build the .jar artifact I > > > > >> > would use the command 'mvn deploy' when I want the .war artifact > > > > >> > I would use: 'mvn -f pom2.xml' ---> after this, I encounter the > > > > >> > problem I mentioned earlier. > > > > >> > > > > > >> > Note that the artifactIds are different. > > > > >> > > > > >> > > > > >> You solution is simple: do not have one project, split it into > > > > >> multiple projects. > > > > >> > > > > >> A war file should not have any java code in it. So there is no need > > > > >> for > > > > you > > > > >> do be having two poms. You war project depends on the jar project > > > > >> and > > > > you > > > > >> are done. > > > > >> > > > > >> There are plenty of examples on how to do this in the freely > > > > >> available maven books at http://maven.apache.org/articles.html > > > > >> > > > > > > > > --------------------------------------------------------------------- > > > > To unsubscribe, e-mail: users-unsubscr...@maven.apache.org > <javascript:;><mailto:users-unsubscr...@maven.apache.org <javascript:;>> > > > > For additional commands, e-mail: users-h...@maven.apache.org > <javascript:;><mailto:users-h...@maven.apache.org <javascript:;>> > > > > > > > > >