pom.xml 14.4 KB
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 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443
<?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-ear</artifactId> <!-- m2eclipse does not like: ${app.context}-ear -->
  <name>${project.artifactId} : ${project.version}</name>
  <description>The Seam Maven reference implementation EAR module</description>
  <packaging>ear</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>
      <!--
        Explode ear to appserver deploy folder. 
        Execute e.g."mvn package -Pexplode"
      -->
      <id>explode</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>package</id>
                <phase>package</phase>
                <configuration>
                  <tasks>
                    <property name="deploy-path" value="${as.deploy}/${app.context}-ear.ear" />
                    <echo>Exploding to ${deploy-path}</echo>
                    <delete	file="${deploy-path}" quiet="true" />
                    <mkdir dir="${deploy-path}" />
                    <sync todir="${deploy-path}" verbose="true" >
                      <fileset dir="${project.build.directory}/${project.build.finalName}" />
                    </sync>
                    <!--
                      Uncomment this tag if you want to deploy the *-ds.xml file to the appserver's deploy folder
                      <copy todir="${as.deploy}" file="${project.build.directory}/${ds.xml}" verbose="true" />
                    -->
                  </tasks>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <!--
        Unexplode ear. Remove project from appserver deploy folder. 
        Execute e.g. "mvn clean -Punexplode"
      -->
      <id>unexplode</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <executions>
              <execution>
                <id>clean</id>
                <phase>clean</phase>
                <configuration>
                  <tasks>
                    <property name="deploy-path" value="${as.deploy}/${app.context}-ear.ear" />
                    
                    <echo>Unexploding: ${deploy-path}</echo>
                    
                    <delete	file="${deploy-path}"	quiet="true" />
                    <delete	dir="${deploy-path}" quiet="true" />
                    <!--
                      Uncomment this tag if you have deployed the *-ds.xml file to the appserver's deploy folder
                      <delete file="${as.deploy}/${ds.xml}"	quiet="true" />
                    -->
                  </tasks>
                </configuration>
                <goals>
                  <goal>run</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <dependencies>
    <!-- project modules -->
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>${app.context}-war</artifactId>
      <type>war</type>
    </dependency>
    
    <dependency>
      <groupId>${project.groupId}</groupId>
      <artifactId>${app.context}-ejb</artifactId>
      <type>ejb</type>
    </dependency>
    
    <!-- other project modules 
    <dependency> 
      <groupId>${project.groupId}</groupId>
      <artifactId>${app.context}-jar</artifactId> 
    </dependency>
    -->

    <!-- seam -->
    <dependency>
      <groupId>org.jboss.seam</groupId>
      <artifactId>jboss-seam</artifactId>
      <type>ejb</type>
    </dependency>

    <dependency>
      <groupId>org.jboss.el</groupId>
      <artifactId>jboss-el</artifactId>
      <type>jar</type>
    </dependency>

    <!-- richfaces -->
    <dependency>
      <groupId>org.richfaces.framework</groupId>
      <artifactId>richfaces-api</artifactId>
      <type>jar</type>
    </dependency>

    <!-- hibernate -->
    <!--
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-commons-annotations</artifactId>
      <scope>provided</scope>
    </dependency>
    -->
    
    <!-- commons -->
    <dependency>
      <groupId>commons-beanutils</groupId>
      <artifactId>commons-beanutils</artifactId>
      <type>jar</type>
    </dependency>

    <dependency>
      <groupId>commons-digester</groupId>
      <artifactId>commons-digester</artifactId>
      <type>jar</type>
    </dependency>

    <!-- 
      JBoss Rules. Needed if you implement drools functionality, e.g. Seam Idendity 
      see: samples/jboss-seam/examlpes/seamspace 
    -->
    <!-- 
    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-core</artifactId>
    </dependency>

    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-compiler</artifactId>
    </dependency>

    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-api</artifactId>
    </dependency>

    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-decisiontables</artifactId>
    </dependency>

    <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-templates</artifactId>
    </dependency>

    <dependency>
      <groupId>com.thoughtworks.xstream</groupId>
      <artifactId>xstream</artifactId>
    </dependency>

    <dependency>
      <groupId>xpp3</groupId>
      <artifactId>xpp3_min</artifactId>
    </dependency>
    -->
    
    <!-- rules + groovy -->
    <!-- 
    <dependency>
      <groupId>org.antlr</groupId>
      <artifactId>antlr-runtime</artifactId>
    </dependency>
    --> 
    
    <!-- Added transient by JBoss Rules 
    <dependency>
      <groupId>org.mvel</groupId>
      <artifactId>mvel2</artifactId>
    </dependency> 

    <dependency>
      <groupId>janino</groupId>
      <artifactId>janino</artifactId>
    </dependency>

    <dependency>
      <groupId>org.eclipse.jdt</groupId>
      <artifactId>core</artifactId>
    </dependency>
    -->

    <!-- JBoss jBPM -->
    <!-- 
    <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-jpdl</artifactId>
    </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>
    -->
    
    <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>
          <execution>
            <!-- Properties needed by unexplode profile -->
            <id>pre-clean</id>
            <phase>pre-clean</phase>
            <goals>
              <goal>read-project-properties</goal>
            </goals>
            <configuration>
              <files>
                <file>${basedir}/../src/main/filters/filter-${env}.properties</file>
              </files>
            </configuration>
          </execution>
        </executions>
      </plugin>		
      
      <!--
        Maven resources plugin The default resources folder for ear is the
        src/main/application folder. Stuff in this folder will go into the
        target ear folder. The projects *-ds.xml file is placed in the
        src/main/resources folder, so we'll have to use the
        maven-resources-plugin to copy the *-ds.xml file. The reason for
        this is that we need to control where to copy the *-ds.xml is in
        the target build. If we want to deploy the *-ds.xml file embedded
        into the ear project then the file is located in the target/ear root
        folder. If the *-ds.xml file should be deployed as a separate service,
        then the file is located the target folder. The explode profile
        will then copy the *-ds.xml file to the application server's deploy
        folder.
      -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <executions>
          <execution>
            <id>copy-app-ds-xml</id>
            <phase>initialize</phase>
            <goals>
              <goal>copy-resources</goal>
            </goals>
            <configuration>

              <!--
                Comment out this tag if you have deployed the *-ds.xml file to the appserver's deploy folder
              -->
              <outputDirectory>${project.build.directory}/${project.build.finalName}/META-INF/ds</outputDirectory>

              <!--
                Uncomment this tag if you have deployed the *-ds.xml file to the appserver's deploy folder
                <outputDirectory>${project.build.directory}</outputDirectory>
              -->
              <resources>
                <resource>
                  <directory>src/main/resources</directory>
                  <filtering>true</filtering>
                  <includes>
                    <include>${ds.xml}</include>
                  </includes>
                </resource>
              </resources>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <!-- Maven EAR plugin -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-ear-plugin</artifactId>
        <configuration>
          <finalName>${app.context}-ear</finalName>
          <displayName>${app.display.name}</displayName>
          <description>${app.description}</description>
          <jboss>
            <!--
              To trigger the generation of the jboss-app.xml file you need to
              configure the 'jboss' element. see:
              http://maven.apache.org/plugins/maven-ear-plugin/usage.html and:
              http://maven.apache.org/plugins/maven-ear-plugin/examples/generating-jboss-app.html
            -->
            <version>${as.version}</version>

            <loader-repository>
              <!--
                seam.jboss.org is a Seam-specific scoped classloader. It acts as
                a way for Seam to disassociate artifacts bundled with the
                application from those that exist within the JBoss application
                server's shared artifacts or JARs (for example, those that
                reside in the default server's lib directory or in JBoss's
                general lib directory). 
                The classloader is referenced in jboss-app.xml for EAR deployment and and in 
                jboss-web.xml for WAR deployment (SiA-2.5.3-p63).
                see: http://www.jboss.org/community/wiki/classloadingconfiguration
                see: http://www.mastertheboss.com/en/jboss-application-server/141-jboss-classloader.html
              -->
              seam.jboss.org:loader=${app.context}-ear
            </loader-repository>

            <!--
              Comment out this tag if you have deployed the *-ds.xml file to the appserver's deploy folder
            -->
            <data-sources>
              <data-source>META-INF/ds/${ds.xml}</data-source>
            </data-sources>
          </jboss>

          <archive>
            <manifestEntries>
              <Build-Date>${timestamp}</Build-Date>
              <Build-Revision>${buildNumber}</Build-Revision>
              <Mode>${env}</Mode>
            </manifestEntries>
          </archive>

          <modules>
            <webModule>
              <groupId>${project.groupId}</groupId>
              <artifactId>${app.context}-war</artifactId>
              <contextRoot>/${app.web.context}</contextRoot>
              <unpack>${app.unpack.modules}</unpack>
            </webModule>

            <ejbModule>
              <groupId>${project.groupId}</groupId>
              <artifactId>${app.context}-ejb</artifactId>
              <unpack>${app.unpack.modules}</unpack>
            </ejbModule>

            <!--
            <jarModule> 
              <groupId>${project.groupId}</groupId>
              <artifactId>${app.context}-jar</artifactId>
              <unpack>${app.unpack.modules}</unpack>
              <includeInApplicationXml>true</includeInApplicationXml>
            </jarModule>
            -->
            
            <ejbModule>
              <groupId>org.jboss.seam</groupId>
              <artifactId>jboss-seam</artifactId>
            </ejbModule>

          </modules>
        </configuration>
      </plugin>
    </plugins>
    
  </build>

</project>