Vimdiff cheat sheet

This tool can be used with git mergetool during a merge operation. This is how can it be used:

  • Browse for differences and retain
:diffget x        - Choose which version you want to keep with 1, 2 and 3 for the source, base and the target copy
]c                  - next difference
[c                  - previous difference
  • Wrap up the changes
:only       - once you’re resolved all conflicts, this shows only the middle/merged file
:wq (save and quit)
  • split navigations
ctrl-w then j, k, h, l
  • Vim’s defaults are useful for changing split shapes:
"Max out the height of the current split
ctrl + w _"Max out the width of the current split
ctrl + w |"Normalize all split sizes, which is very handy when resizing terminal
ctrl + w =

Deploy artifact to maven central

Open a new OSSRH issue here: https://issues.sonatype.org

Following the documentation from here: https://central.sonatype.org/publish/publish-maven/#distribution-management-and-authentication, add a new profile to the project pom:

<profile>
	<id>release</id>
	<activation>
		<property>
			<name>performRelease</name>
			<value>true</value>
		</property>
	</activation>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-source-plugin</artifactId>
				<version>2.2.1</version>
				<executions>
					<execution>
						<id>attach-sources</id>
						<goals>
							<goal>jar-no-fork</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-javadoc-plugin</artifactId>
				<version>2.9.1</version>
				<executions>
					<execution>
						<id>attach-javadocs</id>
						<goals>
							<goal>jar</goal>
						</goals>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-gpg-plugin</artifactId>
				<version>1.5</version>
				<executions>
					<execution>
						<id>sign-artifacts</id>
						<phase>verify</phase>
						<goals>
							<goal>sign</goal>
						</goals>
						<configuration>
							<keyname>${gpg.keyname}</keyname>
							<passphraseServerId>${gpg.passphrase}</passphraseServerId>
							<gpgArguments>
								<arg>--pinentry-mode</arg>
								<arg>loopback</arg>
							</gpgArguments>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>
</profile>

And the distributionManagement section:

	<distributionManagement>
		<snapshotRepository>
			<id>ossrh</id>
			<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
		</snapshotRepository>
		<repository>
			<id>ossrh</id>
			<url>
				https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
		</repository>
	</distributionManagement>

Create a new GPG key and publish the public part of it:

gpg --full-generate-key
gpg --keyserver keyserver.ubuntu.com --send-keys <key-id>

Update the following maven sections in the settings.xml file

<!-- Servers -->
<servers>
  <server>
    <id>ossrh</id>
    <username>sonatype username</username>
    <password>password</password>
  </server>
</servers>

<!-- Profiles -->
<profiles>
  <profile>
    <id>ossrh</id>
    <activation>
      <activeByDefault>true</activeByDefault>
    </activation>
    <properties>
      <gpg.keyname>key name</gpg.keyname>
      <gpg.passphrase>key passphrase</gpg.passphrase>
    </properties>
  </profile>
</profiles>

Build the project and deploy it to the staging area:

mvn clean deploy -P release

Release the previously deployed artifacts, by following these instructions: https://central.sonatype.org/publish/release/