Commits

Stefan Saasen committed 2b323d9

Update the pom to cater for the different deployment options (bundle, bundle and shrink, import only)

  • Participants
  • Parent commits deac68f

Comments (0)

Files changed (1)

     <description>This is an example Confluence plugin written in Scala</description>
     <packaging>atlassian-plugin</packaging>
 
-    <dependencies>
-        <!-- Bundled dependencies -->
-
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.scala-lang</groupId>
+                <artifactId>scala-library</artifactId>
+                <version>${scala.version}</version>
+                <!-- Depending on the profile use (default, bundle or production) this dependency will have
+                    a scope of either compile or provided -->
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
 
-        <!--
-        If you are using the Scala Provider plugin or the Scala library OSGi bundle,
-        change the <scope> to "provided"
-        -->
+    <dependencies>
         <dependency>
             <groupId>org.scala-lang</groupId>
             <artifactId>scala-library</artifactId>
             <version>${scala.version}</version>
-            <!--<scope>provided</scope>-->
-            <!-- Add pluginDep for provided scope -->
         </dependency>
 
-        <!--<dependency>-->
-            <!--<groupId>com.fasterxml</groupId>-->
-            <!--<artifactId>jackson-module-scala</artifactId>-->
-            <!--<version>${jackson.version}</version>-->
-            <!--<exclusions>-->
-                <!--<exclusion>-->
-                    <!--<groupId>com.google.guava</groupId>-->
-                    <!--<artifactId>guava</artifactId>-->
-                <!--</exclusion>-->
-            <!--</exclusions>-->
-        <!--</dependency>-->
-
         <!-- Provided dependencies -->
         <dependency>
             <groupId>com.atlassian.confluence</groupId>
                     </includes>
                 </configuration>
             </plugin>
-            <plugin>
-                <groupId>com.atlassian.maven.plugins</groupId>
-                <artifactId>maven-confluence-plugin</artifactId>
-                <version>3.8</version>
-                <extensions>true</extensions>
-                <configuration>
-                    <productVersion>${confluence.version}</productVersion>
-                    <productDataVersion>${confluence.data.version}</productDataVersion>
-                    <extractDependencies>true</extractDependencies>
-                    <enableFastdev>false</enableFastdev>
-                    <!-- Reloading velocity templates requires (CMD+Shift+Reload) which triggers fastDev
-                    https://developer.atlassian.com/display/DOCS/Automatic+Plugin+Reinstallation+with+FastDev -->
-                    <instructions>
-                        <Import-Package>
-                            scala*;version="${scala.version}",
-                            sun.misc;resolution:=optional,
-                            *
-                        </Import-Package>
-                        <Export-Package>
-                            scala.*;version="${scala.version}"
-                        </Export-Package>
-                    </instructions>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.twdata.maven</groupId>
-                <artifactId>maven-cli-plugin</artifactId>
-                <version>0.7</version>
-                <configuration>
-                    <userAliases>
-                        <pi>resources com.atlassian.maven.plugins:maven-confluence-plugin:filter-plugin-descriptor compile org.scala-tools:maven-scala-plugin:2.13.1:compile com.atlassian.maven.plugins:maven-confluence-plugin:copy-bundled-dependencies com.atlassian.maven.plugins:maven-confluence-plugin:compress-resources com.atlassian.maven.plugins:maven-confluence-plugin:generate-manifest com.atlassian.maven.plugins:maven-confluence-plugin:validate-manifest com.atlassian.maven.plugins:maven-confluence-plugin:jar com.atlassian.maven.plugins:maven-confluence-plugin:install</pi>
-                    </userAliases>
-                </configuration>
-            </plugin>
+
             <plugin>
                 <groupId>org.scala-tools</groupId>
                 <artifactId>maven-scala-plugin</artifactId>
-                <version>2.13.1</version> <!-- Latest version for Maven 2.1.0 (required by Atlassian) -->
+                <version>2.13.1</version>
+                <!-- Latest version for Maven 2.1.0 (required by Atlassian) -->
                 <configuration>
                     <jvmArgs>
                         <jvmArg>-Xms64m</jvmArg>
                     <target>1.6</target>
                 </configuration>
             </plugin>
-
-
         </plugins>
     </build>
 
 
     <profiles>
         <profile>
+            <id>default</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <dependencies>
+                <dependency>
+                    <groupId>org.scala-lang</groupId>
+                    <artifactId>scala-library</artifactId>
+                    <version>${scala.version}</version>
+                    <scope>provided</scope>
+                </dependency>
+            </dependencies>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>com.atlassian.maven.plugins</groupId>
+                        <artifactId>maven-confluence-plugin</artifactId>
+                        <version>3.8</version>
+                        <extensions>true</extensions>
+                        <configuration>
+                            <productVersion>${confluence.version}</productVersion>
+                            <productDataVersion>${confluence.data.version}</productDataVersion>
+                            <extractDependencies>true</extractDependencies>
+                            <enableFastdev>false</enableFastdev>
+                            <!-- Reloading velocity templates requires (CMD+Shift+Reload) which triggers fastDev
+                           https://developer.atlassian.com/display/DOCS/Automatic+Plugin+Reinstallation+with+FastDev -->
+                            <instructions>
+                                <Import-Package>
+                                    scala*;version="${scala.version}",
+                                    sun.misc;resolution:=optional,
+                                    *
+                                </Import-Package>
+                                <Export-Package>
+                                    scala.*;version="${scala.version}"
+                                </Export-Package>
+                            </instructions>
+                            <!-- Automatically add the Scala provider plugin to the application -->
+                            <pluginArtifacts>
+                                <pluginArtifact>
+                                    <groupId>com.atlassian.confluence.plugins</groupId>
+                                    <artifactId>scala-2.9-provider-plugin</artifactId>
+                                    <version>0.2</version>
+                                </pluginArtifact>
+                            </pluginArtifacts>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
+            <id>bundle</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>com.atlassian.maven.plugins</groupId>
+                        <artifactId>maven-confluence-plugin</artifactId>
+                        <version>3.8</version>
+                        <extensions>true</extensions>
+                        <configuration>
+                            <productVersion>${confluence.version}</productVersion>
+                            <productDataVersion>${confluence.data.version}</productDataVersion>
+                            <extractDependencies>true</extractDependencies>
+                            <enableFastdev>false</enableFastdev>
+                            <!-- Reloading velocity templates requires (CMD+Shift+Reload) which triggers fastDev
+                           https://developer.atlassian.com/display/DOCS/Automatic+Plugin+Reinstallation+with+FastDev -->
+                            <instructions>
+                                <Import-Package>
+                                    scala*;version="${scala.version}",
+                                    sun.misc;resolution:=optional,
+                                    *
+                                </Import-Package>
+                                <Export-Package>
+                                    scala.*;version="${scala.version}"
+                                </Export-Package>
+                            </instructions>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+        <profile>
             <id>production</id>
             <build>
                 <plugins>
                             </execution>
                         </executions>
                         <configuration>
+                            <!-- This will need to be adjusted. This matches the JDK layout on Mac OS X -->
+                            <!-- On Linux use ${java.home}/lib/rt.jar instead -->
                             <libs>
-                                <lib>/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar
-                                </lib>
-                                <lib>/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsse.jar</lib>
+                                <lib>${java.home}/../Classes/classes.jar</lib>
+                                <lib>${java.home}/../Classes/jsse.jar</lib>
                             </libs>
                             <includeDependency>false</includeDependency>
                             <injar>${project.build.finalName}-complete.jar</injar>
             </dependencies>
         </profile>
     </profiles>
-
-    <!--
-                    <pluginArtifacts>
-                        <pluginArtifact>
-                            <groupId>com.atlassian.confluence.plugins</groupId>
-                            <artifactId>scala-2.9-provider-plugin</artifactId>
-                            <version>0.2</version>
-                        </pluginArtifact>
-
-                    </pluginArtifacts>
-    -->
 </project>