Difference between revisions of "Uno/Java/MavenBundles"

From Apache OpenOffice Wiki
< Uno‎ | Java
Jump to: navigation, search
(Create POM Files: removed scm from common since they are now in each section)
m (Upload Procedure: changed @ to at in dev list email)
 
(5 intermediate revisions by the same user not shown)
Line 44: Line 44:
 
     <scope>compile</scope>
 
     <scope>compile</scope>
 
   </dependency>
 
   </dependency>
 +
</pre>
 +
 +
To include these in a Gradle based project include these in dependencies as needed:
 +
<pre>
 +
compile "org.openoffice:juh:4.1.2"
 +
compile "org.openoffice:ridl:4.1.2"
 +
compile "org.openoffice:unoil:4.1.2"
 +
compile "org.openoffice:jurt:4.1.2"
 +
compile "org.openoffice:officebean:4.1.2"
 
</pre>
 
</pre>
  
Line 62: Line 71:
  
 
From <source-temp-dir><br />
 
From <source-temp-dir><br />
svn co https://svn.apache.org/repos/asf/openoffice/tags/AOO412/main/javaunohelper  juh<br />
+
<pre>
svn co https://svn.apache.org/repos/asf/openoffice/tags/AOO412/main/jurt  jurt<br />
+
svn co https://svn.apache.org/repos/asf/openoffice/tags/AOO412/main/javaunohelper  juh
svn co https://svn.apache.org/repos/asf/openoffice/tags/AOO412/main/ridljar  ridl<br />
+
svn co https://svn.apache.org/repos/asf/openoffice/tags/AOO412/main/jurt  jurt
svn co https://svn.apache.org/repos/asf/openoffice/tags/AOO412/main/bean  officebean<br />
+
svn co https://svn.apache.org/repos/asf/openoffice/tags/AOO412/main/ridljar  ridl
 
+
svn co https://svn.apache.org/repos/asf/openoffice/tags/AOO412/main/bean  officebean
 +
</pre>
 
=== Create Javadocs ===
 
=== Create Javadocs ===
 
From <javadoc-temp-dir><br />
 
From <javadoc-temp-dir><br />
javadoc -d ./juh -sourcepath <source-temp-dir>/juh -subpackages com<br />
+
<pre>
javadoc -d ./jurt -sourcepath <source-temp-dir>/jurt -subpackages com<br />
+
javadoc -d ./juh -sourcepath <source-temp-dir>/juh -subpackages com
javadoc -d ./ridljar -sourcepath <source-temp-dir>/ridl -subpackages com<br />
+
javadoc -d ./jurt -sourcepath <source-temp-dir>/jurt -subpackages com
javadoc -d ./bean -sourcepath <source-temp-dir>/officebean -subpackages com<br />
+
javadoc -d ./ridljar -sourcepath <source-temp-dir>/ridl -subpackages com
 
+
javadoc -d ./bean -sourcepath <source-temp-dir>/officebean -subpackages com
 +
</pre>
 
=== Create Javadoc Jars ===
 
=== Create Javadoc Jars ===
 
this jar command will change into each directory and run jar <br />
 
this jar command will change into each directory and run jar <br />
 
From <javadoc-temp-dir><br />
 
From <javadoc-temp-dir><br />
jar cvfM juh-4.1.2-javadoc.jar -C ./juh . <br />
+
<pre>
jar cvfM jurt-4.1.2-javadoc.jar -C ./jurt . <br />
+
jar cvfM juh-4.1.2-javadoc.jar -C ./juh .  
jar cvfM ridl-4.1.2-javadoc.jar -C ./ridljar . <br />
+
jar cvfM jurt-4.1.2-javadoc.jar -C ./jurt .  
jar cvfM officebean-4.1.2-javadoc.jar -C ./bean . <br />
+
jar cvfM ridl-4.1.2-javadoc.jar -C ./ridljar .  
 +
jar cvfM officebean-4.1.2-javadoc.jar -C ./bean .  
 +
</pre>
  
Move jar into a <target> directory<br />
+
Move jar files into a <target> directory<br />
 +
<pre>
 
mv *.jar <target>
 
mv *.jar <target>
 
+
</pre>
 
=== Create Source Jars ===
 
=== Create Source Jars ===
 
Change to target directory and create source jars in target dir <br />
 
Change to target directory and create source jars in target dir <br />
jar cvfM juh-4.1.2-sources.jar -C <source-temp-dir>/juh com <br />
+
<pre>
jar cvfM jurt-4.1.2-sources.jar -C <source-temp-dir>/jurt com <br />
+
jar cvfM juh-4.1.2-sources.jar -C <source-temp-dir>/juh com  
jar cvfM ridl-4.1.2-sources.jar -C <source-temp-dir>/ridl com <br />
+
jar cvfM jurt-4.1.2-sources.jar -C <source-temp-dir>/jurt com  
jar cvfM officebean-4.1.2-sources.jar -C <source-temp-dir>/officebean com <br />
+
jar cvfM ridl-4.1.2-sources.jar -C <source-temp-dir>/ridl com  
 
+
jar cvfM officebean-4.1.2-sources.jar -C <source-temp-dir>/officebean com  
 +
</pre>
 
=== Add META-INF Directory and Files ===
 
=== Add META-INF Directory and Files ===
 
Create a META-INF directory and place three text files within.
 
Create a META-INF directory and place three text files within.
Line 107: Line 122:
  
 
Create the empty jar files from <target> directory<br />
 
Create the empty jar files from <target> directory<br />
jar cvfM unoil-4.1.2-sources.jar META-INF/LICENSE META-INF/NOTICE META-INF/README<br />
+
<pre>
jar cvfM unoil-4.1.2-javadoc.jar META-INF/LICENSE META-INF/NOTICE META-INF/README<br />
+
jar cvfM unoil-4.1.2-sources.jar META-INF/LICENSE META-INF/NOTICE META-INF/README
 
+
jar cvfM unoil-4.1.2-javadoc.jar META-INF/LICENSE META-INF/NOTICE META-INF/README
 +
</pre>
 
=== Update Jars With License and Notice Files ===
 
=== Update Jars With License and Notice Files ===
 
Replace text in README file for Ridl:<br />
 
Replace text in README file for Ridl:<br />
Line 120: Line 136:
  
 
From <target> dir add LICENSE and NOTICE files from (and to) META-INF dir in remaining jar files<br />
 
From <target> dir add LICENSE and NOTICE files from (and to) META-INF dir in remaining jar files<br />
jar uf juh-4.1.2-sources.jar META-INF/NOTICE META-INF/LICENSE<br />
+
<pre>
jar uf juh-4.1.2-javadoc.jar META-INF/NOTICE META-INF/LICENSE<br />
+
jar uf juh-4.1.2-sources.jar META-INF/NOTICE META-INF/LICENSE
jar uf jurt-4.1.2-sources.jar META-INF/NOTICE META-INF/LICENSE<br />
+
jar uf juh-4.1.2-javadoc.jar META-INF/NOTICE META-INF/LICENSE
jar uf jurt-4.1.2-javadoc.jar META-INF/NOTICE META-INF/LICENSE<br />
+
jar uf jurt-4.1.2-sources.jar META-INF/NOTICE META-INF/LICENSE
jar uf officebean-4.1.2-sources.jar META-INF/NOTICE META-INF/LICENSE<br />
+
jar uf jurt-4.1.2-javadoc.jar META-INF/NOTICE META-INF/LICENSE
jar uf officebean-4.1.2-javadoc.jar META-INF/NOTICE META-INF/LICENSE<br />
+
jar uf officebean-4.1.2-sources.jar META-INF/NOTICE META-INF/LICENSE
jar uf ridl-4.1.2-sources.jar META-INF/NOTICE META-INF/LICENSE META-INF/README<br />
+
jar uf officebean-4.1.2-javadoc.jar META-INF/NOTICE META-INF/LICENSE
jar uf ridl-4.1.2-javadoc.jar META-INF/NOTICE META-INF/LICENSE META-INF/README<br />
+
jar uf ridl-4.1.2-sources.jar META-INF/NOTICE META-INF/LICENSE META-INF/README
 +
jar uf ridl-4.1.2-javadoc.jar META-INF/NOTICE META-INF/LICENSE META-INF/README
 +
</pre>
 
Note: Unoil sources and javadoc have already been added.<br />
 
Note: Unoil sources and javadoc have already been added.<br />
  
Line 212: Line 230:
 
=== PGP Sign Files ===
 
=== PGP Sign Files ===
 
Sign all the files in <target> directory. For each file:<br />
 
Sign all the files in <target> directory. For each file:<br />
 +
<pre>
 
gpg -ab <filename><br />
 
gpg -ab <filename><br />
 
+
</pre>
 
+
 
=== Create Maven Bundles ===
 
=== Create Maven Bundles ===
 
Create each bundle:<br />
 
Create each bundle:<br />
jar -cvf juh-4.1.2-bundle.jar juh*.* <br />
+
<pre>
jar -cvf jurt-4.1.2-bundle.jar jurt*.* <br />
+
jar -cvf juh-4.1.2-bundle.jar juh*.*  
jar -cvf officebean-4.1.2-bundle.jar officebean*.* <br />
+
jar -cvf jurt-4.1.2-bundle.jar jurt*.*  
jar -cvf ridl-4.1.2-bundle.jar ridl*.* <br />
+
jar -cvf officebean-4.1.2-bundle.jar officebean*.*  
jar -cvf unoil-4.1.2-bundle.jar unoil*.* <br />
+
jar -cvf ridl-4.1.2-bundle.jar ridl*.*  
 
+
jar -cvf unoil-4.1.2-bundle.jar unoil*.*  
 +
</pre>
 
== Upload Procedure ==
 
== Upload Procedure ==
 
The following information describes how to upload new versions of the JARs to the Maven repository; if you just want to use the JARs you don't need to read it.
 
The following information describes how to upload new versions of the JARs to the Maven repository; if you just want to use the JARs you don't need to read it.
Line 230: Line 249:
 
Apache projects use the Apache Nexus repository at https://repository.apache.org/ to upload bundles to. The files are then synchronized with other repositories.
 
Apache projects use the Apache Nexus repository at https://repository.apache.org/ to upload bundles to. The files are then synchronized with other repositories.
  
For the 4.1.2 release, since this was a release of jars that were part of an earlier official release, a proposal was made on the dev@openoffice.apache.org mailing list and lazy-consensus was used for approval.
+
For the 4.1.2 release, since this was a release of jars that were part of an earlier official release, a proposal was made on the dev at openoffice.apache.org mailing list and lazy-consensus was used for approval prior to a release of the bundles.
  
 
[[Category:Uno:Java]]
 
[[Category:Uno:Java]]
 
[[Category:Maven]]
 
[[Category:Maven]]

Latest revision as of 11:39, 21 December 2015

Maven Bundles for Java Uno JARs

Maven 2 is a popular Java build tool that provides many useful features for building Java projects, including dependency management.

The Java Uno JAR files are available from the Maven Central Repository, so that projects that use Java Uno can fully benefit from Maven dependency management features.

The available JAR files, or artifacts, are

To include those Java/Uno libraries into your project managed by Maven you'll typically declare the following dependencies in your pom.xml:

  <dependency>
    <groupId>org.openoffice</groupId>
    <artifactId>juh</artifactId>
    <version>4.1.2</version>
    <scope>compile</scope>
  </dependency>
  <dependency>
    <groupId>org.openoffice</groupId>
    <artifactId>jurt</artifactId>
    <version>4.1.2</version>
    <scope>compile</scope>
  </dependency>
  <dependency>
    <groupId>org.openoffice</groupId>
    <artifactId>ridl</artifactId>
    <version>4.1.2</version>
    <scope>compile</scope>
  </dependency>
  <dependency>
    <groupId>org.openoffice</groupId>
    <artifactId>unoil</artifactId>
    <version>4.1.2</version>
    <scope>compile</scope>
  </dependency>
  <dependency>
    <groupId>org.openoffice</groupId>
    <artifactId>officebean</artifactId>
    <version>4.1.2</version>
    <scope>compile</scope>
  </dependency>

To include these in a Gradle based project include these in dependencies as needed:

compile "org.openoffice:juh:4.1.2"
compile "org.openoffice:ridl:4.1.2"
compile "org.openoffice:unoil:4.1.2"
compile "org.openoffice:jurt:4.1.2"
compile "org.openoffice:officebean:4.1.2"

Bundle Contents

The Maven repository requires a bundle jar that includes a compiled jar. source jar, javadoc jar, and a pom xml file. Each bundle ex. juh-4.1.2-bundle.jar will contain the following files

  • juh-4.1.2.jar - contains compiles classes
  • juh-4.1.2-sources.jar - contains java source files
  • juh-4.1.2-javadoc.jar - contains javadoc html files
  • juh-4.1.2.pom - contains the XML descriptor

In addition each file will have an accompanying external signature file ex. juh-4.1.2.jar.asc signature file created during the PGP signing process.


Bundle Creation Procedure

This procedure documents a manual process until a more automated one can be implemented.

Copy Source Files

Copy source files from the subversion release tag to a local temp directory <source-temp-dir>

From <source-temp-dir>

svn co https://svn.apache.org/repos/asf/openoffice/tags/AOO412/main/javaunohelper  juh
svn co https://svn.apache.org/repos/asf/openoffice/tags/AOO412/main/jurt  jurt
svn co https://svn.apache.org/repos/asf/openoffice/tags/AOO412/main/ridljar  ridl
svn co https://svn.apache.org/repos/asf/openoffice/tags/AOO412/main/bean  officebean

Create Javadocs

From <javadoc-temp-dir>

javadoc -d ./juh -sourcepath <source-temp-dir>/juh -subpackages com
javadoc -d ./jurt -sourcepath <source-temp-dir>/jurt -subpackages com
javadoc -d ./ridljar -sourcepath <source-temp-dir>/ridl -subpackages com
javadoc -d ./bean -sourcepath <source-temp-dir>/officebean -subpackages com

Create Javadoc Jars

this jar command will change into each directory and run jar
From <javadoc-temp-dir>

jar cvfM juh-4.1.2-javadoc.jar -C ./juh . 
jar cvfM jurt-4.1.2-javadoc.jar -C ./jurt . 
jar cvfM ridl-4.1.2-javadoc.jar -C ./ridljar . 
jar cvfM officebean-4.1.2-javadoc.jar -C ./bean . 

Move jar files into a <target> directory

mv *.jar <target>

Create Source Jars

Change to target directory and create source jars in target dir

jar cvfM juh-4.1.2-sources.jar -C <source-temp-dir>/juh com 
jar cvfM jurt-4.1.2-sources.jar -C <source-temp-dir>/jurt com 
jar cvfM ridl-4.1.2-sources.jar -C <source-temp-dir>/ridl com 
jar cvfM officebean-4.1.2-sources.jar -C <source-temp-dir>/officebean com 

Add META-INF Directory and Files

Create a META-INF directory and place three text files within.

  • LICENSE - contains the Apache 2.0 license
  • NOTICE - contains the copyright notice
  • README - contains an explanation of the missing source and javadoc files in ridl and unoil source and javadoc jars. The contents are different between the two as described below.

Create Empty Unoil Source and Javadoc Jars

The Maven Repository requires a sources and javadoc jar even if they are empty. We need to include a README file to explain this. The contents of the README file for unoil should contain:
No Java source files or Javadocs exist for the UNO Interface Library.
unoil.jar is built from class files generated from IDL files during a complete build of Apache OpenOffice.
The IDL documentation can be found here:
http://www.openoffice.org/api/docs/common/ref/com/sun/star/module-ix.html

Create the empty jar files from <target> directory

jar cvfM unoil-4.1.2-sources.jar META-INF/LICENSE META-INF/NOTICE META-INF/README
jar cvfM unoil-4.1.2-javadoc.jar META-INF/LICENSE META-INF/NOTICE META-INF/README

Update Jars With License and Notice Files

Replace text in README file for Ridl:
Not all Java source files or Javadocs exist for the Runtime Interface Definition Library.
ridl.jar is built from a combination of Java source files and class files
generated from IDL files during a complete build of Apache OpenOffice.
The IDL documentation can be found here:
http://www.openoffice.org/api/docs/common/ref/com/sun/star/module-ix.html
Available Java sources and generated Javadocs are included in their respective jars.

From <target> dir add LICENSE and NOTICE files from (and to) META-INF dir in remaining jar files

jar uf juh-4.1.2-sources.jar META-INF/NOTICE META-INF/LICENSE
jar uf juh-4.1.2-javadoc.jar META-INF/NOTICE META-INF/LICENSE
jar uf jurt-4.1.2-sources.jar META-INF/NOTICE META-INF/LICENSE
jar uf jurt-4.1.2-javadoc.jar META-INF/NOTICE META-INF/LICENSE
jar uf officebean-4.1.2-sources.jar META-INF/NOTICE META-INF/LICENSE
jar uf officebean-4.1.2-javadoc.jar META-INF/NOTICE META-INF/LICENSE
jar uf ridl-4.1.2-sources.jar META-INF/NOTICE META-INF/LICENSE META-INF/README
jar uf ridl-4.1.2-javadoc.jar META-INF/NOTICE META-INF/LICENSE META-INF/README

Note: Unoil sources and javadoc have already been added.

Create POM Files

A guide can be found at http://maven.apache.org/guides/mini/guide-central-repository-upload.html and the files can be found here https://repo1.maven.org/maven2/org/openoffice/
Name the pom files the same as the classes jar except extension ex. juh-4.1.2.pom

Each artifact (JAR file) needs to be packaged into a bundle that also includes an XML file (juh-4.1.2.pom) containing information about the artifact, including name, description, version, license, and dependencies.

Some of the values provided in the XML description files are provided below. A complete example can be found in the Maven Repository address listed above.

Element Value
Common to all artifacts
groupId org.openoffice
version the OOo version that shipped this JAR, e.g.: 4.1.2
url https://wiki.openoffice.org/wiki/Uno
license name The Apache License, Version 2.0
license url http://www.apache.org/licenses/LICENSE-2.0.txt
Artifact: juh
artifactId juh
name OpenOffice.org "javaunohelper" module
description Various tools and adapters for Java Uno.
scm url http://svn.apache.org/repos/asf/openoffice/trunk/main/javaunohelper
scm connection http://svn.apache.org/repos/asf/openoffice/trunk/main/javaunohelper
dependencies jurt, ridl
Artifact: jurt
artifactId jurt
name OpenOffice.org "jurt" module
description JURT stands for "Java Uno Runtime". The JURT module basically implements Java Uno.
scm url http://svn.apache.org/repos/asf/openoffice/trunk/main/jurt
scm connection http://svn.apache.org/repos/asf/openoffice/trunk/main/jurt
dependencies ridl
Artifact: ridl
artifactId ridl
name OpenOffice.org "ridl" module
description The "ridljar" module implements the base types for the Java Uno typesystem, as well as a types access library.
scm url http://svn.apache.org/repos/asf/openoffice/trunk/main/ridljar
scm connection http://svn.apache.org/repos/asf/openoffice/trunk/main/ridljar
dependencies -
Artifact: unoil
artifactId unoil
name OpenOffice.org "unoil" module
description Java class files generated from the IDL Files to create the Java UNO Interface.
scm url http://svn.apache.org/repos/asf/openoffice/trunk/main/unoil
scm connection http://svn.apache.org/repos/asf/openoffice/trunk/main/unoil
dependencies ridl

PGP Sign Files

Sign all the files in <target> directory. For each file:

gpg -ab <filename><br />

Create Maven Bundles

Create each bundle:

jar -cvf juh-4.1.2-bundle.jar juh*.* 
jar -cvf jurt-4.1.2-bundle.jar jurt*.* 
jar -cvf officebean-4.1.2-bundle.jar officebean*.* 
jar -cvf ridl-4.1.2-bundle.jar ridl*.* 
jar -cvf unoil-4.1.2-bundle.jar unoil*.* 

Upload Procedure

The following information describes how to upload new versions of the JARs to the Maven repository; if you just want to use the JARs you don't need to read it.

The upload procedure is detailed in Guide to uploading artifacts to The Central Repository. New bundles would be created and uploaded at each OpenOffice.org stable release.

Apache projects use the Apache Nexus repository at https://repository.apache.org/ to upload bundles to. The files are then synchronized with other repositories.

For the 4.1.2 release, since this was a release of jars that were part of an earlier official release, a proposal was made on the dev at openoffice.apache.org mailing list and lazy-consensus was used for approval prior to a release of the bundles.

Personal tools