Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

activate profiles

 
Ranch Hand
Posts: 210
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
 
Marshal
Posts: 3149
466
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • 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: 210
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
Marshal
Posts: 3149
466
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • 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
Marshal
Posts: 3149
466
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • 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: 210
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: 210
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: 210
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
Marshal
Posts: 3149
466
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • 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: 210
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
post / thread SOLVED
 
When evil is afoot and you don't have any arms you gotta be hip and do the legwork, but always kick some ... tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic