Page tree

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

 

Shows how to add the Apptools Maven Plugin to your Confluence add-on project.

Basic Configuration

Simply add the configuration to the POM file of your project.

pluginManagement in pom.xml
<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>

Configure local Server

Then add profiles to configure the Confluence 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).

profile in pom.xml
<profiles>
  <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</serverUrl>
            </configuration>
          </plugin>
        </plugins>
      </pluginManagement>
    </build>
  </profile>
  ...
</profiles>

Then deploy the OBR artifact to the local server by specifying the profile.

mvn apptools:deploy -PLOCAL

Configure remote Server

In case you want to deploy to a remote test server, add a profile like this:

    <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 URL to access the TEST server in your settings.xml.

~/.m2/settings.xml
<settings>
  ...
  <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>
  • No labels