maven-profiles

Default build profile for Maven

…衆ロ難τιáo~ 提交于 2019-12-31 08:53:48
问题 I have added profiling to my Maven project. <profile> <id>da</id> </profile> <profile> <id>live</id> </profile> <profile> <id>dev</id> </profile> When I give the command mvn clean install without specifying the build profile. I need the dev profile to be build by default. How can I achieve this? 回答1: By using the attribute activeByDefault you will be able to select a default profile in Maven when no other profile is selected with the -P parameter. <profiles> <profile> <id>da</id> </profile>

using build number plugin in maven profile to build modules

笑着哭i 提交于 2019-12-25 05:15:47
问题 I have parent project "parent", which has three modules like: <groupId>com.dummy.bla.bla</groupId> <artifactId>parent</artifactId> <version>1.0-SNAPSHOT</version> <packaging>pom</packaging> <modules> <module>A</module> <module>B</module> <module>C</module> </modules> and three modules are depending on each other like a chain: A<--B<--C When I run the build under parent, I will have A-1.0-SNAPSHOT.jar generated first, then B-1.0-SNAPSHOT.jar, finally C-1.0-SNAPSHOT.jar. Then problem is that, I

Different persistence units for different Maven profiles

元气小坏坏 提交于 2019-12-24 09:07:11
问题 I want to use two different databases depending on the selected Maven profile. For the profile "production" I want to use a MySQL database and for the "development" profile I want to use an in-memory HSQLDB. I found out that it is possible to have two persistence.xml files. One in "src/main/resources/META-INF" and the other one stored in "src/test/resources/META-INF". This gives the possibility to choose a different database for testing. But is it also possible to do the database selection

spring boot always using the same profile

*爱你&永不变心* 提交于 2019-12-24 02:28:06
问题 I am using spring boot 1.5.2, and using profiles but I found a very strange thing. my spring boot resources folder like this: configs in application.yml spring: profiles: active: @profileActive@ application-dev.yml spring: profiles: dev datasource: driver-class-name: com.mysql.jdbc.Driver url: jdbc:mysql://localhost:3306/db1 username: root password: server: port: 8080 application-test.yml spring: profiles: test datasource: driver-class-name: com.mysql.jdbc.Driver url: jdbc:mysql://localhost

Values for os.family in Maven profile activation condition

人盡茶涼 提交于 2019-12-21 07:13:43
问题 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? 回答1: The

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

最后都变了- 提交于 2019-12-18 13:31:44
问题 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? 回答1: 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

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

梦想与她 提交于 2019-12-18 12:43:29
问题 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

Maven: property to activate profile in sub-modules

一笑奈何 提交于 2019-12-17 19:59:21
问题 We have a multi-module maven project, and it has different platforms to run on, like JBoss 4 and JBoss 7. We specify the platform property, and then use it as a classifier for artifacts, and for activation of the platform-specific profile in sub-modules, like: <activation> <property> <name>platform</name> <value>jboss71x</value> </property> </activation> in these profiles, we, among other things, specify the versions of provided dependencies. E.g. we do import of jboss parent pom:

Using profiles in multimodule project

≡放荡痞女 提交于 2019-12-13 05:54:01
问题 I have a multimodule maven project. Project layout is described below: PARENT |-CHILD1 |-CHILD2 Parent project has pom packaging type and declares CHILD1 and CHILD2 projects as modules. Also PARENT project declares profile dev which declares some property. CHILD1 project has jar packaging type and "overrides" PARENT dev profile by adding some dependency(dependency on commons-collections for example). CHILD2 project has war packaging type and has dependency on CHILD1 project. Also CHILD2

One profile properties are overriding with another profile properties in maven?

淺唱寂寞╮ 提交于 2019-12-13 00:45:58
问题 I have a problem with maven profiles. Coming to the details, I have two profiles like profile1 and profile2. I have declared few properties for both the profiles along with the modules which needs to be updated by each profile individually. Let see the below configuration, <profiles> <profile> <id>profile1</id> <properties> <owner>ABC</owner> </properties> <modules> <module>module1</module> <module>module2</module> </modules> <profile> <profile> <id>profile2</id> <properties> <owner>XYZ<