<?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>

    <name>JFreeChart as OSGI-bundle</name>
    <artifactId>jfreechart</artifactId>
    <groupId>de.enflexit</groupId>
    <version>1.5.6</version>
    <packaging>jar</packaging>

    <organization>
        <name>JFree.org</name>
        <url>http://www.jfree.org/</url>
    </organization>
    <inceptionYear>2001</inceptionYear>

    <description>
        JFreeChart is a class library, written in Java, for generating charts. 
        Utilising the Java2D API, it supports a wide range of chart types including
        bar charts, pie charts, line charts, XY-plots, time series plots, Sankey charts
        and more.
    </description>

    <url>http://www.jfree.org/jfreechart/</url>
    <issueManagement>
        <url>https://github.com/jfree/jfreechart/issues</url>
        <system>GitHub Issues</system>
    </issueManagement>
    <scm>
        <connection>scm:git:git:https://github.com/jfree/jfreechart.git</connection>
        <url>https://github.com/jfree/jfreechart</url>
    </scm>

    <developers>
      <developer>
        <name>David Gilbert</name>
        <email>dave@jfree.org</email>
      </developer>
    </developers>

    <licenses>
        <license>
            <name>GNU Lesser General Public Licence</name>
            <url>http://www.gnu.org/licenses/lgpl.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.release.level>11</project.release.level>
        <project.source.level>11</project.source.level>
        <project.target.level>11</project.target.level>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-api</artifactId>
            <version>5.8.2</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>5.8.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <distributionManagement>
        <snapshotRepository>
          <id>ossrh</id>
          <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>    
    
    <build>
        <testSourceDirectory>src/test/java</testSourceDirectory>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.2.0</version>
            </plugin>            

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.10.1</version>
                <configuration>
                    <release>${project.release.level}</release>
                    <source>${project.source.level}</source>
                    <target>${project.target.level}</target>
                    <encoding>${project.build.sourceEncoding}</encoding>                
                    <showWarnings>true</showWarnings>
                    <showDeprecation>true</showDeprecation>
                </configuration>
            </plugin>

             <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.2</version>
                <configuration>
			    <archive>  
			      <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
			    </archive> 
			  </configuration>
            </plugin>

			<plugin>
				<!--https://bnd.bndtools.org/tools/felix-maven.html-->
				<!--
				https://felix.apache.org/documentation/subprojects/apache-felix-maven-bundle-plugin-bnd.html-->
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<version>5.1.9</version>
				<extensions>true</extensions>
				<!-- Executions only needed in combination with jar plugin -->
				<executions>
					<execution>
						<id>bundle-manifest</id>
						<phase>process-classes</phase>
						<goals>
							<goal>manifest</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<manifestLocation>${project.build.outputDirectory}/META-INF/</manifestLocation>
					<instructions>
						<!-- Varibales set above under properties-->
						<Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
						<Bundle-Version>${project.version}</Bundle-Version>
						<Bundle-Vendor>JFree.org</Bundle-Vendor>
						<!-- Include and export all packages under the package jade and fipa -->
						<Export-Package>org.jfree.*;version=!;-noimport:=true</Export-Package>
						<Import-Package>!*</Import-Package>
						<!--
		              Include the Jars of the dependencies stated in this pom under lib/dependency
		            
			        <Bundle-ClassPath>.,{maven-dependencies}</Bundle-ClassPath>
                    <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
                    <Embed-Transitive>true</Embed-Transitive>
                    -->
					</instructions>
				</configuration>
			</plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>3.4.0</version>
                <configuration>
                    <source>11</source>
                    <linksource>true</linksource>
                    <docfilessubdirs>true</docfilessubdirs>
                </configuration>
            </plugin>
            
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M7</version>
            </plugin>
            <plugin>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>3.0.0-M7</version>
            </plugin>       

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-install-plugin</artifactId>
                <version>3.0.0-M1</version>
            </plugin>
          
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.10.0</version>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-report-plugin</artifactId>
                <version>3.0.0-M5</version>
            </plugin>
                
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jxr-plugin</artifactId>
                <version>3.1.1</version>
            </plugin>

        </plugins>
    </reporting>

    <profiles>
        <profile> 
            <id>release</id>
            <build>
                <plugins>
                
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>3.2.0</version>
                        <executions>
                            <execution>
                                <id>attach-sources</id>
                                <goals>
                                    <goal>jar-no-fork</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    
                    <plugin>
                        <inherited>true</inherited>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>3.3.1</version>
                        <configuration>
                            <linksource>true</linksource>
							<docfilessubdirs>true</docfilessubdirs>
                        	<failOnError>false</failOnError>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadoc</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>3.0.1</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                                <configuration>
                                	<gpgArguments>
                                		<arg>--pinentry-mode</arg>
					                    <arg>loopback</arg>
                                	</gpgArguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

					<!-- Deploys the JAR to MVN Central-->
					<plugin>
						<groupId>org.sonatype.central</groupId>
						<artifactId>central-publishing-maven-plugin</artifactId>
						<version>0.1.2</version>
						<extensions>true</extensions>
						<configuration>
							<publishingServerId>central</publishingServerId>
							<tokenEnabled>true</tokenEnabled>
						</configuration>
					</plugin>

                </plugins>
            </build>
        </profile>
    </profiles>
</project>
