• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ways to highlight common steps in Maven Profiles

 
Kirill Levan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!
I have POM.xml like this:


Which ways can I use to take out the common actions to avoid copy/paste?

After that, how can I identify in my Java code which profile executes now?

I need this because the code is pretty common for both profiles, I can't separate it, so I want to create some condition in my java code, where I'll be able to choose further actions according to current Profile. I've tried to use SystemProperty configuration in my pom.xml by It was unsuccessful, I wasn't able to get this property by System.getProperty(..) and also I doubt that this is a good way.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34229
341
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it an option to create a third profile for the common code?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic