maven-profiles

Activating a settings.xml Defined Maven Profile From POM File

孤街醉人 提交于 2019-12-04 06:09:50
问题 Our enterprise team maintains a settings.xml file that defines various profiles that development projects can use with Maven to build their artifacts and install them in a repository. The expectation is that each project in Jenkins would define a -P parameter with the desired profile specified. Here is my issue: The profile I need to use specifies a repository that is normally not visible to my project (a staged release repository), so anything in that repository cannot be depended upon

Values for os.family in Maven profile activation condition

纵然是瞬间 提交于 2019-12-03 22:51:33
Maven allows to activate certain build profiles based on the operating system family it runs on, for example: <profile> <activation> <os><family>Windows</family></os> </activation> </profile> There is a number of question around this: what are allowed values for os.family then? Are they case sensitive? Does Linux come across as Unix ? Or unix ? And so on. Where can I find information about allowed values – or, at least, where does Maven take these values from? Environment variables? The values are defined in the plexus-utils project, in Os.java . You can see in isOs that the match is case

Using the properties tag within maven profiles

北城以北 提交于 2019-12-03 05:46:31
I am in reference to " Maven: The Complete Reference " and especially the section regarding profiles which documents the use of a <properties... tag within the <profile... tag here: see here <profile> <id>development</id> <activation> <activeByDefault>true</activeByDefault> <property> <name>environment.type</name> <value>dev</value> </property> </activation> <properties> <database.driverClassName>com.mysql.jdbc.Driver</database.driverClassName> <database.url> jdbc:mysql://localhost:3306/app_dev </database.url> <database.user>development_user</database.user> <database.password>development

How to overwrite files in the WAR file during maven build?

倖福魔咒の 提交于 2019-11-30 13:24:15
问题 I have a Java webapp project that I develop in Eclipse (more precisely MyEclipse 10) and build using Maven 3. I have the following layout (including only the files relevant to my problem : project root |-- src | |-- main | | |-- java | | |-- resources | | | |-- log4j.xml | | | +-- struts.properties | | |-- webapp | | | |-- META-INF | | | | +--context.xml | | |-- config | | | |-- test | | | | |--log4j.xml | | | | |--struts.properties | | | | +--context.xml | | | +-- prod | | | | |--log4j.xml |

WARNING The requested profile “pom.xml” could not be activated because it does not exist

喜夏-厌秋 提交于 2019-11-30 10:20:27
I am trying to run maven goal: validation and keep getting: [WARNING] The requested profile "pom.xml" could not be activated because it does not exist. In my org.eclipse.m2e.core.prefs: activeProfiles=pom.xml eclipse.preferences.version=1 resolveWorkspaceProjects=true version=1 What did I do wrong? Right click on your project Go to "Run as" Go to "Run configurations... " When the screen opens, please delete the word "pom.xml" from the "Profiles:" line and then click "Run". The project will now run. Your activeProfiles is set to pom.xml . But your Maven profile should be defined inside your pom

How do I invoke two different profiles in one maven command?

て烟熏妆下的殇ゞ 提交于 2019-11-30 07:49:08
I have two profiles for different environments in pom.xml , I have to run mvn -PTest1 install and mvn -PTest2 install command to get these profiles in use. Can we integrate two separate maven commands in a single one (like mvn clean install )? Here is my Pom entry <profiles> <profile> <id>Test1</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.5</jdk> <os> <name>Windows XP</name> <family>Windows</family> <arch>x86</arch> <version>5.1.2600</version> </os> <property> <name>sparrow-type</name> <value>African</value> </property> </activation> <dependencies> <dependency> <groupId>

How to overwrite files in the WAR file during maven build?

♀尐吖头ヾ 提交于 2019-11-30 07:11:38
I have a Java webapp project that I develop in Eclipse (more precisely MyEclipse 10) and build using Maven 3. I have the following layout (including only the files relevant to my problem : project root |-- src | |-- main | | |-- java | | |-- resources | | | |-- log4j.xml | | | +-- struts.properties | | |-- webapp | | | |-- META-INF | | | | +--context.xml | | |-- config | | | |-- test | | | | |--log4j.xml | | | | |--struts.properties | | | | +--context.xml | | | +-- prod | | | | |--log4j.xml | | | | |--struts.properties | | | | +--context.xml | +--test +--pom.xml As you can see, I included a

Inherited profiles in Maven

末鹿安然 提交于 2019-11-30 07:08:48
I have the following profiles in my parent pom <profile> <id>P1</id> <activation> <activeByDefault>true</activeByDefault> </activation> </profile> <profile> <id>P2</id> <activation> <file> <exists>${project.basedir}/src/main/whatever</exists> </file> </activation> </profile> Why P1 is active in child POM and P2 isn't? The directory ${project.basedir}/src/main/whatever , does not exist in the parent project, but exists in the child one. linski Profile P2 is not activated because the path under its exists tag does not resolve to an existing path even though the directory ${project.basedir}/src

Inheriting Maven profiles

你。 提交于 2019-11-30 06:41:54
问题 Is it possible for a child POM to inherit profiles defined in the parent POM? If so, how? 回答1: Profiles defined in a parent POM are inherited in a child POM extending the parent, there is nothing to do. And just in case, the Maven Help Plugin has very useful goals allowing to deal with profiles: help:active-profiles : lists the profiles which are currently active for the build. help:all-profiles : lists the available profiles under the current project. 回答2: I don't think it is inherited. http

Does using activeByDefault go against maven best practices?

删除回忆录丶 提交于 2019-11-29 10:37:28
I wish to find out whether Never use <activeByDefault > is a maven best practice? The advice here around this seems pretty sound, but do you think it's absolute or if there are some cases in which it would not apply ? Am posting a snapshot of the content on that page for posterity: 来源: https://stackoverflow.com/questions/16167206/does-using-activebydefault-go-against-maven-best-practices