Difference between revisions of "Uno/Java/MavenBundles"

From Apache OpenOffice Wiki
< Uno‎ | Java
Jump to: navigation, search
(Bundle Creation Procedure: added create javadoc jar)
(Create Source Jars: added section (checkpoint save))
Line 74: Line 74:
 
javadoc -d ./bean -sourcepath <source-temp-dir>/officebean -subpackages com<br />
 
javadoc -d ./bean -sourcepath <source-temp-dir>/officebean -subpackages com<br />
  
=== Create Javadoc Jar ===
+
=== 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 />
Line 81: Line 81:
 
jar cvfM ridl-4.1.2-javadoc.jar -C ./ridljar . <br />
 
jar cvfM ridl-4.1.2-javadoc.jar -C ./ridljar . <br />
 
jar cvfM officebean-4.1.2-javadoc.jar -C ./bean . <br />
 
jar cvfM officebean-4.1.2-javadoc.jar -C ./bean . <br />
 +
 +
Move jar into a <target> directory<br />
 +
mv *.jar <target>
 +
 +
=== Create Source Jars ===
 +
Change to target directory <br />
 +
create source jars in target dir <br />
 +
jar cvfM juh-4.1.2-sources.jar -C ~/dev-svn/aoo-jars-tmp/juh com <br />
 +
jar cvfM jurt-4.1.2-sources.jar -C ~/dev-svn/aoo-jars-tmp/jurt com <br />
 +
jar cvfM ridl-4.1.2-sources.jar -C ~/dev-svn/aoo-jars-tmp/ridl com <br />
 +
jar cvfM officebean-4.1.2-sources.jar -C ~/dev-svn/aoo-jars-tmp/officebean com <br />
  
 
== Upload Procedure ==
 
== Upload Procedure ==

Revision as of 11:27, 20 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>

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 into a <target> directory
mv *.jar <target>

Create Source Jars

Change to target directory
create source jars in target dir
jar cvfM juh-4.1.2-sources.jar -C ~/dev-svn/aoo-jars-tmp/juh com
jar cvfM jurt-4.1.2-sources.jar -C ~/dev-svn/aoo-jars-tmp/jurt com
jar cvfM ridl-4.1.2-sources.jar -C ~/dev-svn/aoo-jars-tmp/ridl com
jar cvfM officebean-4.1.2-sources.jar -C ~/dev-svn/aoo-jars-tmp/officebean com

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.

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

The values provided in the XML description files are

Element Value
Common to all artifacts
groupId org.openoffice
version the OOo version that shipped this JAR, e.g.: 2.1.0
url http://udk.openoffice.org
license name GNU Lesser General Public License, Version 2.1
license url http://www.openoffice.org/licenses/lgpl_license.html
scm url http://udk.openoffice.org/source/browse/api/
scm connection scm:cvs:pserver:anoncvs@anoncvs.services.openoffice.org:/cvs
Artifact: juh
artifactId juh
name OpenOffice.org "javaunohelper" module
description Various tools and adapters for Java Uno.
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.
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.
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.
dependencies ridl
Personal tools