Using profiles to control which Maven modules are built

Found the solution guys, define ‘x’ profile first and the ‘default’ and it works fine (insane Maven!!). Here’s the final result: <profiles> <!– DO NOT CHANGE THE *ORDER* IN WHICH THESE PROFILES ARE DEFINED! –> <profile> <id>x</id> <modules> <module>m1</module> </modules> </profile> <profile> <id>default</id> <activation> <activeByDefault>true</activeByDefault> </activation> <modules> <module>m1</module> <module>m2</module> <module>m3</module> </modules> </profile> </profiles>

How to set active spring 3.1 environment profile via a properites file and not via an env variable or system property

In web.xml <context-param> <param-name>spring.profiles.active</param-name> <param-value>profileName</param-value> </context-param> Using WebApplicationInitializer This approach is used when you don’t have a web.xml file in Servlet 3.0 environment and are bootstrapping the Spring completely from Java: class SpringInitializer extends WebApplicationInitializer { void onStartup(ServletContext container) { AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext(); rootContext.getEnvironment().setActiveProfiles(“profileName”); rootContext.register(SpringConfiguration.class); container.addListener(new ContextLoaderListener(rootContext)); } } Where SpringConfiguration class is … Read more

Default profile in Spring 3.1

Define your production environment as default profile in your web.xml <context-param> <param-name>spring.profiles.default</param-name> <param-value>prod</param-value> </context-param> and if you want to use a different profile pass it as system property mvn -Dspring.profiles.active=”demo” jetty:run

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)