31 March 2018

Organization the project

no snapshit ...

Upgrade to java 9 and stream it necesassry

Intellij is powerfull but this upgrade is work.
It is mostly focus on java 8 to java 9.
To change it I found are some detailed changes.

Things have fot each project.
The general project setting won't work at intellij.

rest back 2nd finger menue "select ...".
On tab "General" set "User settings file" to point to the settings xml.

On tab "Runner" set JRE to the java 9.
On the "Run comfiguration" tab "Runner" set extra java
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home
to prevent javadoc to fail.
d.h. no delivery via sonatype

** change dependency

javax.annotation.Nonnull
javax.annotation.meta.TypeQualifierDefault

are not reachable so use

<dependency>
        <groupId>com.github.spotbugs</groupId>
        <artifactId>spotbugs-annotations</artifactId>
        <version>3.1.1</version>
</dependency>

What to do to deliver a jar to maven central?

Basically follow some open source logic and follow sonatype issues.

  1. Project in a git

Create your own project with really new name.

  1. Choose an open source license

Only a usually one, e.g. BSD-2-cause, Apache-2, Gpl-3.
In doubt go to spdx.org to get details.
Follow the rules.

But BSD-2-cause has consequences for you to done.
Just list toplevel in the project.

  1. Create your new project

For organization order there rules or follow (just structure)
https://github.com/openCage/roast

  1. Get gpg

Todo what and how

  1. Some Information in pom.xml

pfabulist-parent
the parent pom for all bigger pfabulist projects, with all checks
http://www.github.com/openCage/pfabulist-parent

<artifactId>pfabulist-parent</artifactId>
<version>3.2.6</version>
<packaging>pom</packaging>

<licenses>
    <license>
        <name>bsd-2-clause</name>
        <comments>Copyright 2017 Stephan Pfab</comments>
    </license>
</licenses>

<scm>
    <url>git://git@github.com:openCage/pfabulist-parent.git</url>
    <connection>scm:git:git@github.com:openCage/pfabulist-parent</connection>
    <developerConnection>scm:git:git@github.com:openCage/pfabulist-parent.git</developerConnection>
</scm>

  <profiles>
        <profile>
            <id>oss</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>

                    <plugin>
                        <groupId>org.sonatype.plugins</groupId>
                        <artifactId>nexus-staging-maven-plugin</artifactId>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh</serverId>
                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>true</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>


    <distributionManagement>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>
  1. Get or have your own page.

That might cost you money.

  1. Work with sonatype

http://todo list the rules.

  1. Bring to maven-central

First or later delivery is the same.

You need a project that is clean.
a) all dependencies are public available
b) the version number is new
c) all your test work (run install first)
d) mvn deploy

The last transports all to maven-central