Created
March 29, 2012 21:18
-
-
Save pdudits/2243895 to your computer and use it in GitHub Desktop.
depswitch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/api-dev/target/ | |
/api-deploy/target/ | |
/application/target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.dudits.depswitch.application; | |
import net.dudits.depswitch.api.Constants; | |
/** | |
* Hello world! | |
* | |
*/ | |
public class App | |
{ | |
public static void main( String[] args ) | |
{ | |
System.out.println( "This application is meant for "+Constants.PURPOSE ); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.dudits.depswitch.api; | |
/** | |
* Imagine e. g. JNDI names used e. g. in {@code @EJB(lookup=)} annotations. | |
* @author Patrik | |
*/ | |
public class Constants { | |
public static final String PURPOSE="deployment"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.dudits.depswitch.api; | |
/** | |
* Imagine e. g. JNDI names used e. g. in {@code @EJB(lookup=)} annotations. | |
* @author Patrik | |
*/ | |
public class Constants { | |
public static final String PURPOSE="development"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<modelVersion>4.0.0</modelVersion> | |
<parent> | |
<groupId>net.dudits.depswitch</groupId> | |
<artifactId>depswitch</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
</parent> | |
<artifactId>api-deploy</artifactId> | |
<name>api-deploy</name> | |
<properties> | |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |
</properties> | |
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<modelVersion>4.0.0</modelVersion> | |
<parent> | |
<groupId>net.dudits.depswitch</groupId> | |
<artifactId>depswitch</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
</parent> | |
<artifactId>api-dev</artifactId> | |
<name>api-dev</name> | |
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<modelVersion>4.0.0</modelVersion> | |
<parent> | |
<groupId>net.dudits.depswitch</groupId> | |
<artifactId>depswitch</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
</parent> | |
<artifactId>application</artifactId> | |
<name>application</name> | |
<build> | |
<pluginManagement> | |
<plugins> | |
<plugin> | |
<groupId>org.codehaus.mojo</groupId> | |
<artifactId>exec-maven-plugin</artifactId> | |
<configuration> | |
<mainClass>net.dudits.depswitch.application.App</mainClass> | |
</configuration> | |
</plugin> | |
</plugins> | |
</pluginManagement> | |
</build> | |
<profiles> | |
<profile> | |
<id>dev</id> | |
<activation> | |
<activeByDefault>true</activeByDefault> | |
</activation> | |
<dependencies> | |
<dependency> | |
<groupId>net.dudits.depswitch</groupId> | |
<artifactId>api-dev</artifactId> | |
</dependency> | |
</dependencies> | |
</profile> | |
<profile> | |
<id>deploy</id> | |
<dependencies> | |
<dependency> | |
<groupId>net.dudits.depswitch</groupId> | |
<artifactId>api-deploy</artifactId> | |
</dependency> | |
</dependencies> | |
<build> | |
<pluginManagement> | |
<plugins> | |
<plugin> | |
<artifactId>maven-jar-plugin</artifactId> | |
<configuration> | |
<classifier>deploy</classifier> | |
</configuration> | |
</plugin> | |
</plugins> | |
</pluginManagement> | |
</build> | |
</profile> | |
</profiles> | |
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>net.dudits.depswitch</groupId> | |
<artifactId>depswitch</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<packaging>pom</packaging> | |
<name>depswitch</name> | |
<description>Switch dependencies based on profiles</description> | |
<modules> | |
<module>api-dev</module> | |
<module>api-deploy</module> | |
<module>application</module> | |
</modules> | |
<dependencyManagement> | |
<dependencies> | |
<dependency> | |
<groupId>net.dudits.depswitch</groupId> | |
<artifactId>api-dev</artifactId> | |
<version>${project.version}</version> | |
</dependency> | |
<dependency> | |
<groupId>net.dudits.depswitch</groupId> | |
<artifactId>api-deploy</artifactId> | |
<version>${project.version}</version> | |
</dependency> | |
</dependencies> | |
</dependencyManagement> | |
</project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment