0

I have a long pom file with multiple plugins and specifications. I read in other answers like this or this other one that I should add the line <finalName>desiderTitle.war</finalName> under the section, but I also have more than one of these and can't understand or guess in which one and why I should add it. It should become something like this:

 <build>
   <finalName>WhatEverYouLikey</finalName>
 </build>

I tried to search for tutorials on this, with no success.

Community
  • 1
  • 1
GondraKkal
  • 87
  • 2
  • 16
  • 1
    There is only one build section. Can you post your current POM? – Tunaki Jan 31 '17 at 13:58
  • 1
    What do you mean by "I also have more than one of these..."? Each pom.xml should have only the one `...` element. – Steve C Jan 31 '17 at 13:58
  • Sadly I cannot post it, because it's an university project I'm working on and I'm not sure I can share it (even if it's just the pom file). However I've just noticed that the build tags are each under a profile tag. Does it help? Let's say I have just a single build tag OR I understand which of these build tag is the correct one. Do I have to add the tag in a specific order/position, wrapped inside it with some kind of correlation to the other tags? – GondraKkal Jan 31 '17 at 14:05
  • 2
    Tags in pom.xml files are (in general) not ordered. Therefore `...` can be anywhere within the `...`, so long as the build tag is it's immediate container. – Steve C Jan 31 '17 at 14:15

1 Answers1

1

Sounds like you are confused about the profiles in your POM. Take a look here to understand the concept.

Basically, profiles are a way to build the project in different ways. So multiple <build> tags can be present under each profile, and different finalNames can be specified.

You can select the profile using the -P <profileName> option when you build the project.

Amila
  • 5,195
  • 1
  • 27
  • 46