= Parent POM

:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


The starter app parent POM is provided as a convenience to act as the `<parent>` for Apache Causeway applications.
It builds upon a similar POM provided by the Spring Boot framework, which ensures a consistent set of dependencies, as well as configuring various build plugins.

== Usage

To use it, just add:

[source,xml,subs="attributes+"]
.pom.xml
----
<parent>
    <groupId>org.apache.causeway.app</groupId>
    <artifactId>causeway-app-starter-parent</artifactId>
    <version>{page-causewayrel}</version>                    <!--.-->
</parent>
----
<.> update as required for new versions of the framework.

You'll see that it is used by both the xref:docs:starters:helloworld.adoc[HelloWorld] and xref:docs:starters:simpleapp.adoc[SimpleApp] starter apps.

== Relationship to other POMs

The diagram below shows how the starter POM (on the right hand side) relates to other POMs:

image::pom-hierarchy.drawio.png[]


As the diagram shows, the parent POM inherits two Spring Boot parent POMs: directly from `org.springframework.boot:spring-boot-starter-parent`, and transitively inherits from `org.springframework.boot:spring-boot-dependencies`.

* `spring-boot-starter-parent` configures various `<build>/<plugins>` and `<resources>`, while
* `spring-boot-dependencies` the second defines numerous `xxx.version` properties for various third party applications (validated as being compatible with each other by the Spring Boot team), and sets up corresponding `<dependencyManagement>/<dependencies>`.

The parent POM also import (using `scope=import, type=pom`) each of the "bill of material" POMs provided by Apache Causeway framework:

* `org.apache.causeway.core:causeway` -
+
The two core modules most commonly referenced by domain applications are `o.a.c.core:causeway-applib` and `o.a.c.core:causeway-schema`.

* `o.a.c.testing:causeway-testing`
+
For the `causeway-testing-xxx` modules (fixture scripts, unit test support, integ test support etc)

* `o.a.c.extensions:causeway-extensions`

* `o.a.c.subdomains:causeway-subdomains`

* `o.a.c.valuetypes:causeway-valuetypes`

* `o.a.c.incubator:causeway-incubator`

* `o.a.c.legacy:causeway-legacy`

These all set up `<dependencyManagement>/<dependencies>` entries for all of the modules, meaning that there's only one place to update the version to Apache Causeway (the reference to the parent POM).


[#surefire-configuration]
== Surefire Configuration

The parent pom configuresthe Maven surefire plugin to execute multiple times, based on test class suffix.
The suffixes are:

* `Test` (unit tests, if any)
+
this will explicitly _exclude_ any integration tests, though, as defined by ...

* `IntegTest` (integ tests, if any)

// for 2.0.0-M6, add:
//* `IntegBddSpecs` (BDD specs, if any)

[NOTE]
====
in 2.0.0-M5 there is a bug in that the `default-test` (default) execution is also implicitly configured, meaning that unit tests and integ tests are executed twice, and BDD specs (if any)are executed once.

This has been fixed for the next milestone, with a separate execution defined for BDD specs.
====

