Blame view

ejb/pom.xml 6.1 KB
Krzysztof Miksa authored
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
<?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/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>no.knowit.seam</groupId>
    <artifactId>seam-refimpl</artifactId>
    <version>1.0-SNAPSHOT</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <artifactId>seam-refimpl-ejb</artifactId> <!-- m2eclipse does not like: ${app.context}-ear -->
  <name>${project.artifactId} : ${project.version}</name>
  <description>The Seam Maven reference implementation EJB module</description>
  <packaging>ejb</packaging>

  <profiles>
    <!--
      More than one profile can be active at once. Since profiles can contain the same types of 
      configuration there can be clashes. If two profiles clash the last to be activated will 
      override configurations in those activated earlier. 
      Note: Any activeByDefault profile will be deactivated if you activate another profile. 
      E.g. running "mvn install -Penv-dev" deactivates the "prod" profile.
     -->
    <profile>
      <id>env-dev</id>
      <properties>
        <env>dev</env>
      </properties>
    </profile>

    <profile>
      <id>env-prod</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <properties>
        <env>prod</env>
      </properties>
    </profile>

    <profile>
      <id>explode</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>ejb-process-classes</id>
                <phase>process-classes</phase>
                <goals>
                  <goal>run</goal>
                </goals>
                <configuration>
                  <tasks>
                    <property
                      name="deploy-path"
                      value="${as.deploy}/${app.context}-ear.ear" />
                    <copy
                      todir="${deploy-path}/${project.build.finalName}.jar"
                      verbose="true">
                      <fileset dir="${project.build.outputDirectory}">
                        <include name="**/*.class" />
                      </fileset>
                    </copy>
                  </tasks>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <dependencies>
    <dependency>
      <groupId>no.knowit.seam</groupId>
      <artifactId>seam-utils-ejb</artifactId>
      <type>ejb</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>no.knowit.seam</groupId>
      <artifactId>seam-utils-openejb</artifactId>
      <type>ejb</type>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <!--
      Maven filter properties are ony visible to
      resources and can not be accessed from the POM.
    
    <filters>
      <filter>../src/main/filters/filter-${env}.properties</filter>
    </filters>
    -->
    
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering> <!-- filtering persistence.xml -->
      </resource>
    </resources>
    
    <testResources>                                                                                                     
      <testResource>                                                                                                    
        <directory>src/test/resources</directory>                                                                 
        <filtering>true</filtering>                                                                               
      </testResource>
      <testResource>                                                                                                    
        <directory>src/test/resources-openejb</directory>                                                                 
        <filtering>true</filtering>                                                                               
      </testResource>
    </testResources>
    
    <plugins>
      <!--
        Maven filter properties are ony visible to resources and can not be 
        accessed from the POM. This is where the Properties Maven Plugin makes
        our life a little easier when dealing with properties that we need to 
        access inside our POM. It provides goals to read and write properties 
        from and to files, and also to set system properties. It's main use-case 
        is loading properties from files instead of declaring them in pom.xml, 
        something that comes in handy when dealing with different environments. 
        The plugin is configured to read properties during the "validate" phase 
        and the properties are then accessible from the pom.
      -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>properties-maven-plugin</artifactId>
        <executions>
          <execution>
            <configuration>
              <files>
                <file>${basedir}/../src/main/filters/filter-${env}.properties</file>
              </files>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <suiteXmlFiles>
            <suiteXmlFile>
              testng.xml
            </suiteXmlFile>
          </suiteXmlFiles>
        </configuration>
      </plugin>
      
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-ejb-plugin</artifactId>
        <configuration>
          <archive>
            <manifestEntries>
              <Build-Date>${timestamp}</Build-Date>
              <Build-Revision>${buildNumber}</Build-Revision>
              <Mode>${env}</Mode>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>
    </plugins>
  </build>

</project>