maven-profiles

How to manage maven profiles through annotations/pom.xml?

我的未来我决定 提交于 2019-12-12 06:18:02
问题 Ref - Maven Profiles I don't want to specify profile through command line arguments while running. Because, if I change it locally, then changes have to be made thoughout CI stream. Scenario: There are basically two profiles "PROD" and "TEST" . I have annotated methods using these. Basically, I connect different databases under different profiles. While the test classes are annotated with @ActiveProfile("TEST") I run tests using mvn clean test-compile failsafe:integraton-test and run

Creating exclusive profiles in maven

核能气质少年 提交于 2019-12-12 05:27:30
问题 I currently have a pom with platform specific profiles (e.g. linux 32bit, windows 64 bit, etc...). Additionally, I have set it up to automatically choose the invoker's platform as a default. Now, assume I am in a linux 32 machine: I also want to build for win64 by invoking mvn -Pwin64 pakage but in doing so, both the linux32 and win64 profiles get activated. I have tried activating the local platform profile with activeProfiles and using ativation tags. The trouble is that -P does not disable

How to avoid the generation of default jar when specifying a final name?

孤街浪徒 提交于 2019-12-12 04:26:16
问题 We are using maven profile to build a jar specific to tomcat. <profile> <id>TOMCAT</id> <build> <plugins> <plugin> <artifactId>maven-jar-plugin</artifactId> <executions> <execution> <id>default-jar</id> <phase>package</phase> <goals> <goal>jar</goal> </goals> <configuration> <finalName>${project.artifactId}-tomcat-${project.version}</finalName> </configuration> </execution> </executions> </plugin> </plugins> </build> <dependencies> <dependency> <groupId>org.apache.activemq</groupId>

Works without maven profile, bug with

﹥>﹥吖頭↗ 提交于 2019-12-12 03:34:10
问题 Here is my problem, So here is my profile in pom.xml : <profiles> <profile> <id>dev</id> <activation> <property> <name>environment</name> <value>dev</value> </property> </activation> </profile> <profile> <id>prod</id> <activation> <property> <name>environment</name> <value>prod</value> </property> </activation> </profile> </profiles> When I use this context.xml, my application works perfectly : <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans"

How to activate maven profile from command line (to build subsystem)

时光怂恿深爱的人放手 提交于 2019-12-07 15:41:20
问题 I have a Maven project https://github.com/paulvi/MavenMultiModule1 with root pom.xml as <modules> <module>MavenModule1</module> <module>MavenModule2</module> </modules> <properties> </properties> <profiles> <profile> <id>p1</id> <modules> <module>MavenModule1</module> </modules> </profile> <profile> <id>p2</id> <modules> <module>MavenModule2</module> </modules> </profile> </profiles> I would like to be able to build subsystem separately, e.g. mvn package -P p1 and mvn package -P p2 Both

Maven and Profiles: Using the same plugin in two different profiles and have both active at the same time

*爱你&永不变心* 提交于 2019-12-06 03:19:50
问题 We use the frontend-maven-plugin for using grunt and bower in our builds. With the Frontend Maven Plugin, I can install NPM locally, use Bower to download Java libraries, and run Grunt to optimize and obfuscate my code. Like this with some simplification: <plugin> <groupId>com.github.eirslett</groupId> <artifactId>frontend-maven-plugin</artifactId> <version>0.0.24</version> <executions> <execution> <id>install node and npm</id> <goals> <goal>install-node-and-npm</goal> </goals> ... <

How to activate maven profile from command line (to build subsystem)

喜你入骨 提交于 2019-12-05 21:26:48
I have a Maven project https://github.com/paulvi/MavenMultiModule1 with root pom.xml as <modules> <module>MavenModule1</module> <module>MavenModule2</module> </modules> <properties> </properties> <profiles> <profile> <id>p1</id> <modules> <module>MavenModule1</module> </modules> </profile> <profile> <id>p2</id> <modules> <module>MavenModule2</module> </modules> </profile> </profiles> I would like to be able to build subsystem separately, e.g. mvn package -P p1 and mvn package -P p2 Both profiles are visible but can't be activated with -P switch mvn help:all-profiles -P p1 That work with other

Enforce exactly one of two Maven profiles

一个人想着一个人 提交于 2019-12-05 02:06:58
I have a Maven project that defines two separate profiles, developer and release (surely you get the drift, here). I want one of these two profiles to be activated at any time, but never both. If both are somehow activated, this build makes no sense and should fail. If neither is activated, this build also makes no sense and should fail. I'm sure I can write some custom plugin code to achieve this, and I might very well end up going that way, but I'd be interested in achieving this using POM configuration (could be using existing plugins from Maven Central). It should be possible to activate

Using the properties tag within maven profiles

纵饮孤独 提交于 2019-12-04 10:37:12
问题 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

Maven and Profiles: Using the same plugin in two different profiles and have both active at the same time

白昼怎懂夜的黑 提交于 2019-12-04 07:35:34
We use the frontend-maven-plugin for using grunt and bower in our builds. With the Frontend Maven Plugin, I can install NPM locally, use Bower to download Java libraries, and run Grunt to optimize and obfuscate my code. Like this with some simplification: <plugin> <groupId>com.github.eirslett</groupId> <artifactId>frontend-maven-plugin</artifactId> <version>0.0.24</version> <executions> <execution> <id>install node and npm</id> <goals> <goal>install-node-and-npm</goal> </goals> ... </execution> <execution> <id>npm-install</id> <goals> <goal>npm</goal> </goals> ... </execution> <execution> <id