maven-profiles

Different SCM for different profiles in Maven

半世苍凉 提交于 2021-02-18 15:18:11
问题 In my project we have to use maben-build-number plugin to construct the final name of the jar, for that purpose we use the revision of the SCN, so we need SCM But we have two SVN on controlled environment without direct access and on our local test environment, so for our pouproses we have to use: <scm> <connection>scm:svn:http://dev.com/svn_repo/trunk</connection> <developerConnection>scm:svn:https://dev.com/svn_repo/trunk</developerConnection> <url>http://dev.com/view.cvs</url> </scm> But

spring maven profile - set properties file based on compilation profile

随声附和 提交于 2021-02-10 12:14:02
问题 I would create some compilation profiles like these: profile name: dev profile name: test profile name: production In src/main/resources I have 3 folders: dev/file.properties test/file.properties production/file.properties Each file contains different values for this properties: - my.prop.one - my.prop.two - my.prop.three After that I would set in Spring classes something like these: @Configuration @PropertySource("file:${profile_name}/file.properties") public class MyConfig{ } How can I do?

spring maven profile - set properties file based on compilation profile

て烟熏妆下的殇ゞ 提交于 2021-02-10 12:12:55
问题 I would create some compilation profiles like these: profile name: dev profile name: test profile name: production In src/main/resources I have 3 folders: dev/file.properties test/file.properties production/file.properties Each file contains different values for this properties: - my.prop.one - my.prop.two - my.prop.three After that I would set in Spring classes something like these: @Configuration @PropertySource("file:${profile_name}/file.properties") public class MyConfig{ } How can I do?

Maven Build Profile Activation

人走茶凉 提交于 2021-02-07 21:52:49
问题 I know there are some related topics but still I can't understand how to do it. I'm learning maven and currently in process of creating build profiles. I want maven to auto detect the currently installed java version on my machine. Let's say I'm working in our office which uses (jdk7) or home (jdk8) , I want the <source> and <target> elements in maven-compiler-plugin pom.xml to auto detect the java -version regardless of environment (office / home). I've read about activation but can't

Is it possible to use proxy only when a specific profile is active in Maven?

∥☆過路亽.° 提交于 2021-02-06 15:15:49
问题 I would like to use proxy only when a specific profile is active. To accomplish this, my guess is to parameterize the <active> property of <proxy> element. However, I am not exactly sure how to accomplish this. Question : How can I use proxy only when a specific profile is active? 回答1: You could try the following approach: <settings> <proxies> <proxy> <id>httpproxy</id> <active>${activate.proxy}</active> <protocol>http</protocol> <host>some.host</host> <port>8080</port> <nonProxyHosts

maven application with multi environment configuration can't deploy on tomcat

随声附和 提交于 2020-04-18 20:39:10
问题 I am trying to configure multi deployment environment for my web application using Spring Boot with Maven. Created several .properties files under src/main/resources/config. db-dev.properties and db-prod.properties consist of db specific information: db.url=jdbc:oracle:thin:@ldap://dev.com/risstg3, db.username=owner db.password=godzilla In the same directory I also have application.properties which reads in the variables defined in these db property files #database info spring.datasource

maven application with multi environment configuration can't deploy on tomcat

我怕爱的太早我们不能终老 提交于 2020-04-18 20:23:32
问题 I am trying to configure multi deployment environment for my web application using Spring Boot with Maven. Created several .properties files under src/main/resources/config. db-dev.properties and db-prod.properties consist of db specific information: db.url=jdbc:oracle:thin:@ldap://dev.com/risstg3, db.username=owner db.password=godzilla In the same directory I also have application.properties which reads in the variables defined in these db property files #database info spring.datasource

Inherited profiles in Maven

痞子三分冷 提交于 2020-01-20 23:33:25
问题 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. 回答1: Profile P2 is not activated because the path under

How to manage artifactory / maven artifact using different profiles

独自空忆成欢 提交于 2020-01-15 03:32:33
问题 i have some problems understanding how to manage different "jar" files generated using different profiles. An example. I have a project : my.project:sample:1.0 And we use two profiles: Using Profile1 is compiling using java 7 and with dependency other:project:1.0 Using Profile2 is compiling using java 6 and with dependency different:project:3.0 Using command line in local environment is easy to manage, but I don't know how to store and manage it on artifactory. We have two different projects

Enforce exactly one of two Maven profiles

房东的猫 提交于 2020-01-02 01:54:11
问题 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