Skip to content

Commit

Permalink
prepare deploy to maven repo, IBMStreams#2522
Browse files Browse the repository at this point in the history
  • Loading branch information
markheger committed Aug 4, 2020
1 parent 799c5b8 commit 740c54b
Show file tree
Hide file tree
Showing 3 changed files with 167 additions and 4 deletions.
9 changes: 5 additions & 4 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,11 @@ For a pull request:

11.a Test install to local maven repository:

* `ant create_mvn_sources_jar`
* `mvn install:install-file -Dfile=com.ibm.streamsx.topology/lib/com.ibm.streamsx.topology.jar -DgroupId=com.ibm.streams -DartifactId=streamsx.topology -Dversion=x.y.z -Dpackaging=jar -Dsources=release-streamsx.topology/maven/topology-sources.jar`

* `ant maven-install`
* Check local repository, for example: `~/.m2/repository/com/ibm/streams/streamsx.topology`
11.b Deploy to Maven central repository

* T.B.D.
* `ant maven-deploy`


46 changes: 46 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@

<target name="create_mvn_sources_jar">
<property name="release.dir" location="${release.base}" />
<delete dir="${release.dir}/maven"/>
<mkdir dir="${release.dir}" />
<mkdir dir="${release.dir}/maven" />
<jar destfile = "${release.dir}/maven/topology-sources.jar">
Expand All @@ -287,6 +288,51 @@
</jar>
</target>

<target name="maven-install" depends="create_mvn_sources_jar,nomaven" if="env.M2_HOME">
<exec executable="mvn" failonerror="true">
<arg value="install:install-file"/>
<arg value="-Dfile=com.ibm.streamsx.topology/lib/com.ibm.streamsx.topology.jar"/>
<arg value="-Dsources=release-streamsx.topology/maven/topology-sources.jar"/>
<arg value="-DpomFile=release-pom.xml"/>
<arg value="-Dversion=1.15.8"/>
</exec>
<exec executable="mvn" failonerror="true">
<arg value="install:install-file"/>
<arg value="-Dfile=release-streamsx.topology/streamsx.topology-v1.15-20200804-1435.tgz"/>
<arg value="-DpomFile=release-pom.xml"/>
<arg value="-Dpackaging=tgz"/>
<arg value="-Dclassifier=toolkit"/>
<arg value="-Dversion=1.15.8"/>
</exec>
</target>

<target name="maven-deploy" depends="create_mvn_sources_jar,nomaven" if="env.M2_HOME">
<exec executable="mvn" failonerror="true">
<arg value="deploy:deploy-file"/>
<arg value="-Dfile=com.ibm.streamsx.topology/lib/com.ibm.streamsx.topology.jar"/>
<arg value="-Dsources=release-streamsx.topology/maven/topology-sources.jar"/>
<arg value="-DpomFile=release-pom.xml"/>
<arg value="-Dversion=1.15.8"/>
<arg value="-DrepositoryId=ossrh"/>
<arg value="-Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/"/>
</exec>
<exec executable="mvn" failonerror="true">
<arg value="deploy:deploy-file"/>
<arg value="-Dfile=release-streamsx.topology/streamsx.topology-v1.15-20200804-1435.tgz"/>
<arg value="-DpomFile=release-pom.xml"/>
<arg value="-Dpackaging=tgz"/>
<arg value="-Dclassifier=toolkit"/>
<arg value="-Dversion=1.15.8"/>
<arg value="-DrepositoryId=ossrh"/>
<arg value="-Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/"/>
</exec>
</target>

<!-- Prints a message if no maven is found. -->
<target name="nomaven" unless="env.M2_HOME">
<echo message="M2_HOME not found in environment"/>
</target>

<target name="get_name">
<echo message="Toolkit name: ${tkinfo.identity.name}"/>
<echo message="Toolkit full version: ${tkinfo.identity.version}"/>
Expand Down
116 changes: 116 additions & 0 deletions release-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.ibm.streams</groupId>
<artifactId>streamsx.topology</artifactId>
<packaging>jar</packaging>

<name>${project.groupId}:${project.artifactId}</name>
<description>Java API to allow creation of streaming applications for IBM Streams</description>
<url>https://github.com/IBMStreams/streamsx.topology</url>

<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>

<developers>
<developer>
<name>IBMStreams</name>
<email>mark-oliver.heger@de.ibm.com</email>
<organization>IBMStreams</organization>
<organizationUrl>https://github.com/IBMStreams</organizationUrl>
</developer>
</developers>

<scm>
<connection>scm:git:https://github.com:IBMStreams/streamsx.topology.git</connection>
<developerConnection>scm:git:ssh://github.com:IBMStreams/streamsx.topology.git</developerConnection>
<url>https://github.com/IBMStreams/streamsx.topology</url>
<tag>HEAD</tag>
</scm>

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

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<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>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>

0 comments on commit 740c54b

Please sign in to comment.