Date: Thu, 28 Mar 2024 13:09:46 +0100 (CET) Message-ID: <1731519655.17385.1711627786273@09e9d69a2016> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_17384_1200248486.1711627786273" ------=_Part_17384_1200248486.1711627786273 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Shows how to add the Appt= ools Maven Plugin to your Confluence add-on project.
The following shows a configuration where the different target environme= nts are configured with the POM file. This makes the different environments= immediately accessible to users of the project.
Unfortunately this configuration lacks flexibility in case you administr= ate more than one project. In this case you may want to check the alternati= ve configuration we show at the end of this tutorial.
Simply add the configuration to the POM file of your project.
<build> ... <pluginManagement> <plugins> ... <plugin> <groupId>de.smartics.maven.plugin</groupId> <artifactId>apptools-maven-plugin</artifactId> <version>0.12.0</version> <configuration> <sourceFolder>${basedir}/target</sourceFolder> <includes> <include>${project.artifactId}$</include> </includes> <acceptedFilenameExtensions> <extension>obr</extension> </acceptedFilenameExtensions> </configuration> </plugin> </plugins> </pluginManagement> ... </build>
Use the extension jar
, if your app is not bundled in an OBR=
.
We recommend the practice of configuring different environments in build profiles as part = of the Maven POM fi= le.
Per convention we use all-uppercase identifiers for profiles that contai= n environments. The Apptools Maven Plugin is able to recognize environment profiles wi= th this convention.
This is a short tutorial on how environment configurations can be stored= with build profiles.
The following shows a configuration where the different target environme= nts are configured with the POM file. This makes the different environments= immediately accessible to users of the project.
Unfortunately this configuration lacks flexibility in case you administr= ate more than one project. In this case you may want to check the alternati= ve configuration we show at the end of this document.
Add build profiles to configure the Confluence= a> servers you want to deploy to.
The following shows the deployment to the locally started Confluence on =
a developer machine (with default password and user admin
).
<prof= iles> <profile> <id>LOCAL</id> <activation> <activeByDefault /> </activation> <build> <pluginManagement> <plugins> <plugin> <groupId>de.smartics.maven.plugin</groupId> <artifactId>apptools-maven-plugin</artifactId> <configuration> <username>admin</username> <password>admin</password> <serverUrl>http://localhost:1990/confluence</serverU= rl> </configuration> </plugin> </plugins> </pluginManagement> </build> </profile> ... </profiles>
Deploy the OSGi Bundle Repository (OBR) artifact to the local server= by specifying the build profile.
mvn apptool= s:deploy -PLOCAL
In case you want to deploy to a remote test server, add a build profile.=
<= profile> <id>TEST</id> <build> <pluginManagement> <plugins> <plugin> <groupId>de.smartics.maven.plugin</groupId> <artifactId>apptools-maven-plugin</artifactId> <configuration> <serverId>confluence-test</serverId> <serverUrl>${my.server.url.TEST}</serverUrl> </configuration> </plugin> </plugins> </pluginManagement> </build> </profile>
Provide the credentials and the uniform resource locator (UR= L) to access the TEST server in your Maven Settings= file.
<sett= ings> ... <servers> ... <server> <id>confluence-test</id> <username>jane.doe</username> <password>{HllO1A....}</password> </server> </servers> ... <profiles> <profile> <my.server.url.TEST>https://www.mycorp.example.com/confluence= </my.server.url.TEST> </properties> </profile> ... </profiles> </settings>
Since the POM is bundled with your artifact, the URL to the test systems= is not be revealed, if specified as a property provided with the settings = file. This way it is also easier to change the URL for all your projects wi= thout the need to update each POM individually.
= span>Deploy the OBR artifact to the remote test server by specifying the buil= d profile.
mvn apptool= s:deploy -PTEST
This configuration has advantages when environments need to be added or = removed.
With the configuration explained above you would need to alter the POM f= ile of every project. You can keep this configuration effort local to the s= ettings file if you use the following configuration in your POMs:
<build> ... <pluginManagement> <plugins> ... <plugin> <groupId>de.smartics.maven.plugin</groupId> <artifactId>apptools-maven-plugin</artifactId> <version>0.12.0</version> <configuration> ... <!-- same as above, plus: --> <serverId>${my-project.apptools.remote.server.id}</serve= rId> <serverUrl>${my-project.apptools.remote.server.url}</ser= verUrl> </configuration> </plugin> </plugins> </pluginManagement> ... </build>
Then in your settings.xml
add =
the following as a profile element for each of your environments.
<settings> ... <servers> <server> <id>my-server-id</id> <username>janedoe</username> <password>{swldfcm .... ssdfsdaf323=3D}</password> </server> </servers> ... <profiles> <profile> <id>MY_ENV_ID</id> <properties> <projectdoc.apptools.remote.server.id>my-server-id</projec= tdoc.apptools.remote.server.id> <projectdoc.apptools.remote.server.url>https://myserver/confl= uence</projectdoc.apptools.remote.server.url> </properties> </profile> </profiles> </settings>