• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

activate profiles  RSS feed

 
Ranch Hand
Posts: 163
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have trouble understanding the activation of the profiles in the pom.xml, indeed I would like to make a test profile and a profile of production.
I read this link here  https://maven.apache.org/guides/introduction/introduction-to-profiles.html but I dont lose!
here is an excerpt from my pom.xml:



maven tells me that I duplicate profiles, I tested several solutions but alas without much positive results.
how to activate the profiles?

regards
philippe
 
Bartender
Posts: 2038
273
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like you have two profiles named test.
 
Philippe Ponceblanc
Ranch Hand
Posts: 163
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ron McLeod wrote:It looks like you have two profiles named test.



i do like this :

and without       <id>test</id>  just  <value>test</value>
maven tell me :

[ERROR]   The project org.exemple.demo:mon-appli:1.1-SNAPSHOT (/home/phipo/maven-projets/demo/mon-appli/pom.xml) has 1 error
[ERROR]     'profiles.profile.id' must be unique but found duplicate profile with id default @ line 71, column 12

 
Ron McLeod
Bartender
Posts: 2038
273
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

[ERROR]     'profiles.profile.id' must be unique but found duplicate profile with id default @ line 71, column 12


I don't use maven, so this is only a guess:
   - you have 4 profile elements in your XML document
   - two of them are explicitly identified (test and prod), and two are not
   - the profile elements without the id sub-element are implicitly given the id default (I don't know if this is actually true)
   - whatever is processing the document determines you have two profiles with the id of default


 
Ron McLeod
Bartender
Posts: 2038
273
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is from the schema for pom version 4:
I appears that the default value for id actually is default.
 
Philippe Ponceblanc
Ranch Hand
Posts: 163
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ron McLeod wrote:

[ERROR]     'profiles.profile.id' must be unique but found duplicate profile with id default @ line 71, column 12


I don't use maven, so this is only a guess:
   - you have 4 profile elements in your XML document
   - two of them are explicitly identified (test and prod), and two are not
   - the profile elements without the id sub-element are implicitly given the id default (I don't know if this is actually true)
   - whatever is processing the document determines you have two profiles with the id of default




this is my output with your code sample !
 
Philippe Ponceblanc
Ranch Hand
Posts: 163
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ron McLeod wrote:This is from the schema for pom version 4:
I appears that the default value for id actually is default.



where i put your script in my pom.xml ?
 
Philippe Ponceblanc
Ranch Hand
Posts: 163
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I found the solution maven since eclipse returns no error.
On the other hand in VT terminal mode, I have errors:






 
Ron McLeod
Bartender
Posts: 2038
273
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The build log says: Failed to delete /home/phipo/maven-projets/demo/mon-appli/target/mon-appli-1.1-SNAPSHOT.jar

Maybe there is a file permissions/ownership issue?
 
Philippe Ponceblanc
Ranch Hand
Posts: 163
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
post / thread SOLVED
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!