<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>9</version>
    </parent>

    <groupId>pl.wavesoftware</groupId>
    <artifactId>netbeans-eid-generator</artifactId>
    <version>0.2.0</version>
    <packaging>nbm</packaging>

    <name>Exception ID (EID) Generator</name>
    <description><![CDATA[
		<p>Generates a unique Exception ID, that can be used in Java source code.</p>

		<p>In order to use this plugin type <code>Ctrl+Space</code> inside empty String literal. This will generate new unique identifier as a <i>Code Completion</i>. That generated EID can be used, for example, to identify your exceptions.</p>

        <p>
            Example usage (This is technical runtime exception, a posible bug. This plugin can be used to quickly fill unique bug id.):<br />
            <code>try {<br />
&nbsp;&nbsp;&nbsp;&nbsp;shuldWorkIfNoBugsExists();<br />
} catch (IOException ex) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;throw new EidRuntimeException("20140218:161429", "Something wrong with HDD, permissions?", ex);<br />
}</code>
        </p>
	]]></description>

    <url>https://github.com/wavesoftware/eid-generator</url>

    <licenses>
        <license>
            <name>The MIT License (MIT)</name>
            <url>http://opensource.org/licenses/MIT</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <organization>
        <name>Wave Software</name>
        <url>http://wavesoftware.pl</url>
    </organization>

    <developers>
        <developer>
            <id>ksuszynski</id>
            <name>Krzysztof Suszyński</name>
            <email>krzysztof.suszynski@wavesoftware.pl</email>
        </developer>
    </developers>

    <properties>
        <netbeans.hint.license>mit</netbeans.hint.license>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <netbeans.run.params.ide />
        <netbeans.run.params>${netbeans.run.params.ide}</netbeans.run.params>
    </properties>

    <scm>
        <connection>scm:git:https://github.com/wavesoftware/eid-generator.git</connection>
        <developerConnection>scm:git:git@github.com:wavesoftware/eid-generator.git</developerConnection>
        <url>https://github.com/wavesoftware/eid-generator</url>
    </scm>

    <repositories>
        <repository>
            <id>netbeans</id>
            <name>NetBeans</name>
            <url>http://bits.netbeans.org/maven2/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.netbeans.api</groupId>
            <artifactId>org-netbeans-api-annotations-common</artifactId>
            <version>RELEASE74</version>
        </dependency>
        <dependency>
            <groupId>org.netbeans.api</groupId>
            <artifactId>org-netbeans-modules-editor-completion</artifactId>
            <version>RELEASE74</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>org.netbeans.api</groupId>
            <artifactId>org-openide-util</artifactId>
            <version>RELEASE74</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.10</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>1.9.5</version>
            <scope>test</scope>
            <type>jar</type>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>nbm-maven-plugin</artifactId>
                <version>3.13</version>
                <extensions>true</extensions>
                <configuration>
                    <licenseName>The MIT License (MIT)</licenseName>
                    <licenseFile>LICENSE</licenseFile>
                    <keystore>src/release/nbm-keystore.jks</keystore>
                    <keystorealias>${user.name}</keystorealias>
                </configuration>
            </plugin>

            <plugin>
                <!-- NetBeans 6.9+ requires JDK 6, starting NetBeans 7.4 source 1.7 will be required   -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <!-- to have the jar plugin pickup the nbm generated manifest -->
                    <useDefaultManifestFile>true</useDefaultManifestFile>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>

        <profile>
            <id>sonatype-oss-release</id>
            <build>
                <defaultGoal>validate</defaultGoal>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <version>1.7</version>
                        <executions>
                            <execution>
                                <id>catch-keystorepass</id>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <phase>validate</phase>
                                <configuration>
                                    <target>
                                        <!-- == catch password in a prompt == -->
                                        <input message="Please enter password for signing NBM with user `${user.name}`: " addproperty="keystorepass">
                                            <handler classname="org.apache.tools.ant.input.SecureInputHandler" />
                                        </input>
                                    </target>
                                    <exportAntProperties>true</exportAntProperties>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.ant</groupId>
                                <artifactId>ant</artifactId>
                                <version>1.9.3</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>nbm-release</id>
            <build>
                <defaultGoal>validate</defaultGoal>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-antrun-plugin</artifactId>
                        <version>1.7</version>
                        <executions>
                            <execution>
                                <id>catch-keystorepass</id>
                                <goals>
                                    <goal>run</goal>
                                </goals>
                                <phase>validate</phase>
                                <configuration>
                                    <target>
                                        <!-- == catch password in a prompt == -->
                                        <input message="Please enter password for signing NBM with user `${user.name}`: " addproperty="keystorepass">
                                            <handler classname="org.apache.tools.ant.input.SecureInputHandler" />
                                        </input>
                                    </target>
                                    <exportAntProperties>true</exportAntProperties>
                                </configuration>
                            </execution>
                        </executions>
                        <dependencies>
                            <dependency>
                                <groupId>org.apache.ant</groupId>
                                <artifactId>ant</artifactId>
                                <version>1.9.3</version>
                            </dependency>
                        </dependencies>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
