Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Triquetrum/Ptolemy/osgi-2-0"

(Setting up the p2 repository: Cleaned up markup, added a link to issue #114.)
(Updated link to p2 update site)
(2 intermediate revisions by one other user not shown)
Line 4: Line 4:
 
* [[Triquetrum/Ptolemy/Porting | Ptolemy/Porting]] - more user friendly instructions about how to port Ptolemy actors to Triquetrum
 
* [[Triquetrum/Ptolemy/Porting | Ptolemy/Porting]] - more user friendly instructions about how to port Ptolemy actors to Triquetrum
 
* [http://terra.eecs.berkeley.edu:8080/job/ptIIosgi Ptolemy II osgi-2-0 Jenkins build]
 
* [http://terra.eecs.berkeley.edu:8080/job/ptIIosgi Ptolemy II osgi-2-0 Jenkins build]
* https://chess.eecs.berkeley.edu/triq/update - Ptolemy II osgi-2-0 update site
+
* https://chess.eecs.berkeley.edu/triq/p2/osgi-2-0/ - Ptolemy II osgi-2-0 update site
  
 
== Setting up a nightly build ==
 
== Setting up a nightly build ==
Line 269: Line 269:
 
Clearly, the artifactId would need to be changed.
 
Clearly, the artifactId would need to be changed.
  
==== Setting up the p2 repository ====
+
== The Ptolemy II osgi-2-0 p2 repository ==
 +
The Ptolemy II osgi-2-0 p2 repository is at https://chess.eecs.berkeley.edu/triq/p2/osgi-2-0/
 +
 
 +
 
 +
=== Setting up the p2 repository ===
 +
 
 
We want to create a p2 repository for these files, see [https://github.com/eclipse/triquetrum/issues/114 Bug #114: Create a p2 site for the Ptolemy II bundles]]
 
We want to create a p2 repository for these files, see [https://github.com/eclipse/triquetrum/issues/114 Bug #114: Create a p2 site for the Ptolemy II bundles]]
  
Line 286: Line 291:
 
# Create osgi-2-0/features/pom.xml
 
# Create osgi-2-0/features/pom.xml
 
# Running "mvn verify" creates ./releng/org.ptolemy.tycho.update/target/repository/plugins/diva_11.0.0.201606291522.jar
 
# Running "mvn verify" creates ./releng/org.ptolemy.tycho.update/target/repository/plugins/diva_11.0.0.201606291522.jar
 +
 +
In the [http://terra.eecs.berkeley.edu:8080/job/ptIIosgi/ osgi-2-0 Jenkins build], one of the steps publishes artifacts to a SSH site on moog.  The contents of releng/org.ptolemy.tycho.update/target/** are copied to ~www/cvswww/chess.eecs.berkeley.edu/triq/.  A symbolic link from ~www/cvswww/chess.eecs.berkeley.edu/triq/p2/osgi-2-0 to ../releng/org.ptolemy.tycho.update/target/repository was created.

Revision as of 13:38, 30 August 2016

This page is notes about how the Ptolemy II osgi-2-0 repository that contains the Ptolemy II sources used by Triquetrum was set up. It is probably not that useful to most people.

See Also

Setting up a nightly build

We would like to set up a nightly build, so we want to run Maven, create jar files and make them available somehow.

See Check out the ptII osgi-2-0 branch for getting access to the Ptolemy II osgi-2-0 repository

Creating pom files

POM-less Tycho Builds suggests creating osgi-2-0/.mvn/extensions.xml:

<?xml version="1.0" encoding="UTF-8"?>
<extensions>
  <extension>
    <groupId>org.eclipse.tycho.extras</groupId>
    <artifactId>tycho-pomless</artifactId>
    <version>0.24.0</version>
  </extension>
</extensions>

The Eclipse Tycho Tutorial suggests:

 cd osgi-2-0
 mvn org.eclipse.tycho:tycho-pomgenerator-plugin:generate-poms -DgroupId=ptolemy

This creates osgi-2-0/pom.xml and other */pom.xml files.

We then remove the */pom.xml files that were created:

 rm */pom.xml

Running mvn

The Eclipse Tycho Tutorial suggests running

 mvn clean verify

The tutorial states:

"Tip: It is not recommended to use the mvn clean install command, instead you should use mvn clean verify. If you would use the install option, the build result would be installed in your local Maven repository and this can lead to build problems.

The tutorial states:

"Warning If you try to execute this POM file, the build fail because you have not yet configured your dependencies."

mvn clean fails

If we run

mvn clean

we get

[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: diva 11.0.0.qualifier
[ERROR]   Missing requirement: diva 11.0.0.qualifier requires 'package org.w3c.dom.svg 1.1.0' but it could not be found
[ERROR]
[ERROR] See http://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting for help.
[ERROR] Cannot resolve dependencies of MavenProject: ptolemy:diva:11.0.0-SNAPSHOT @ /Users/cxh/src/osgi-2-0/diva/.polyglot.build.properties: See log for details -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MavenExecutionException

So the next step is to fix the dependencies.

Fixing a dependency problem

Looking at Understanding Missing Requirement Messages and Using p2 update sites for dependencies resolutionUsing p2 update sites for dependencies resolution, the solution is to add the following to the osgi-2-0/pom.xml file:

  <repositories>
    <repository>
      <id>eclipse-mars</id>
      <url>http://download.eclipse.org/releases/mars</url>
      <layout>p2</layout>
    </repository>
  </repositories>

After that

 mvn clean

works

mvn verify fails

However,

 mvn verify 

fails:

[INFO] Building diva 11.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.w3c.dom.svg:svg-dom-java:jar:1.1.0 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] osgi-2-0 ........................................... SUCCESS [  0.002 s]
[INFO] diva ............................................... FAILURE [  0.058 s]
[INFO] org.ptolemy.testsupport ............................ SKIPPED
[INFO] org.ptolemy.commons ................................ SKIPPED
[INFO] ptolemy.core ....................................... SKIPPED
[INFO] ptolemy.moml ....................................... SKIPPED
[INFO] ptolemy.actor.lib .................................. SKIPPED
[INFO] ptolemy.domains.sdf ................................ SKIPPED
[INFO] org.ptolemy.actor.gui.test ......................... SKIPPED
[INFO] ptolemy.domains.process ............................ SKIPPED
[INFO] org.ptolemy.core.test .............................. SKIPPED
[INFO] org.ptolemy.core.test.actor ........................ SKIPPED
[INFO] ptolemy.actor.lib.gui .............................. SKIPPED
[INFO] ptolemy.gui ........................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.218 s
[INFO] Finished at: 2016-06-28T16:32:25-07:00
[INFO] Final Memory: 92M/504M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project diva: Could not resolve dependencies for project ptolemy:diva:eclipse-plugin:11.0.0-SNAPSHOT: Failure to find org.w3c.dom.svg:svg-dom-java:jar:1.1.0 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :diva

The fix was to remove the following from osgi-2-0/pom.xml:

  <dependencies>
    <!-- https://mvnrepository.com/artifact/org.axsl.org.w3c.dom.svg/svg-dom-java -->
    <dependency>
      <groupId>org.w3c.dom.svg</groupId>
      <artifactId>svg-dom-java</artifactId>
      <version>1.1.0</version>
    </dependency>
  </dependencies>

mvn verify fails because of GenerateHTMLTest

Running

 mvn verify

fails:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.24.0:compile (
default-compile) on project org.ptolemy.actor.gui.test: Compilation failure: Compilation failure:
[ERROR] /Users/cxh/src/osgi-2-0/org.ptolemy.actor.gui.test/src/test/java/org/ptolemy/actor/gui/test/GenerateHTMLTest.java:[39]
[ERROR] import ptolemy.actor.gui.GenerateCopyrights;
[ERROR] ^^^^^^^^^^^^^^^^^
[ERROR] The import ptolemy.actor.gui cannot be resolved
[ERROR] /Users/cxh/src/osgi-2-0/org.ptolemy.actor.gui.test/src/test/java/org/ptolemy/actor/gui/test/GenerateHTMLTest.java:[59]
[ERROR] System.out.println(GenerateCopyrights.generateHTML(null));
[ERROR] ^^^^^^^^^^^^^^^^^^
[ERROR] GenerateCopyrights cannot be resolved
[ERROR] 2 problems (2 errors)

A workaround:

 rm org.ptolemy.actor.gui.test/src/test/java/org/ptolemy/actor/gui/test/GenerateHTMLTest.java

However it seems like we don't have the dependencies properly set up.

Editing osgi-2-0/org.ptolemy.actor.gui.test/META-INF/MANIFEST.MF and adding a trailing comma and

  ptolemy.gui;bundle-version="10.1.0"

so that we have

Require-Bundle: org.ptolemy.testsupport;bundle-version="10.1.0",
 ptolemy.core;bundle-version="10.1.0",
 ptolemy.actor.lib;bundle-version="10.1.0",
 ptolemy.domains.sdf;bundle-version="10.1.0",
 ptolemy.gui;bundle-version="10.1.0"

IconAttribute

Running:

 mvn verify 

fails with:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.24.0:compile (
default-compile) on project ptolemy.gui: Compilation failure: Compilation failure:
[ERROR] /Users/cxh/src/osgi-2-0/ptolemy.gui/src/ptolemy/vergil/icon/EditorIcon.java:[52]
[ERROR] import ptolemy.kernel.util.IconAttribute;
[ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ERROR] Access restriction: The type 'IconAttribute' is not API (restriction on classpath entry '/Users/cxh/src/osgi-2-0/ptolemy.core/target/classes')

Access restriction on class due to restriction on required library rt.jar? (Stackoverflow) refers to What is the latest on "Access restriction" compilation errors, which suggests adding:

<plugin>
    <groupId>org.eclipse.tycho</groupId>
    <artifactId>tycho-compiler-plugin</artifactId>
    <version>${tycho.version}</version>
    <configuration>
        <compilerArgument>-warn:+discouraged,forbidden</compilerArgument>
    </configuration>
</plugin>

The ${tycho.version} was causing problems, so at the top of pom.xml we added:

  <properties>
    <target-version>0.1.0-SNAPSHOT</target-version>
    <tycho-version>0.24.0</tycho-version>
  </properties>

and then added the following to the plugins section

      <!-- See http://dev.eclipse.org/mhonarc/lists/tycho-user/msg03670.html -->
      <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-compiler-plugin</artifactId>
        <version>${tycho-version}</version>
        <configuration>
          <compilerArgument>-warn:+discouraged,forbidden</compilerArgument>
        </configuration>
      </plugin>

Now

 mvn verify

works!

No explicit target runtime environment configuration

Running

 mvn verify

produces

[WARNING] No explicit target runtime environment configuration. Build is platform dependent.

So we add the following:

      <!-- This configures the target platform and the supported architectures. -->
      <plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>target-platform-configuration</artifactId>
        <version>${tycho-version}</version>
        <configuration>
          <environments>
            <environment>
              <os>linux</os>
              <ws>gtk</ws>
              <arch>x86</arch>
            </environment>
            <environment>
              <os>linux</os>
              <ws>gtk</ws>
              <arch>x86_64</arch>
            </environment>
            <environment>
              <os>win32</os>
              <ws>win32</ws>
              <arch>x86</arch>
            </environment>
            <environment>
              <os>win32</os>
              <ws>win32</ws>
              <arch>x86_64</arch>
            </environment>
            <environment>
              <os>macosx</os>
              <ws>cocoa</ws>
              <arch>x86_64</arch>
            </environment>
          </environments>
        </configuration>
      </plugin>

See the triquetrum pom.xml for an additional target section that could go in this plugin:

        <target>
          <artifact>
            <groupId>triquetrum</groupId>
            <artifactId>org.eclipse.triquetrum.target.platform</artifactId>
            <version>0.1.0-SNAPSHOT</version>
          </artifact>
        </target>

Clearly, the artifactId would need to be changed.

The Ptolemy II osgi-2-0 p2 repository

The Ptolemy II osgi-2-0 p2 repository is at https://chess.eecs.berkeley.edu/triq/p2/osgi-2-0/


Setting up the p2 repository

We want to create a p2 repository for these files, see Bug #114: Create a p2 site for the Ptolemy II bundles]

This was a bit tricky. Follow the Eclipse Tycho Tutorial

I followed the releng/ and features/ subdirectory structure proposed by the tutorial, but this might not be necessary.

Below are the steps that were used to set up the releng/ and features/ directories. These steps are already done and the results are checked in to the osgi-2-0 repo.

  1. Checked out the repo with: svn co https://repo.eecs.berkeley.edu/svn/projects/eal/ptII/branches/osgi-2-0
  2. mkdir -p osgi-2-0/releng/org.ptolemy.tycho.update
  3. Create the org.ptolemy.tycho.update project in the above directory
  4. Create osgi-2-0/releng/pom.xml
  5. mkdir -p osgi-2-0/features/org.ptolemy.tycho.feature
  6. Create the org.ptolemy.tycho.feature project in the above directory
  7. Create osgi-2-0/features/pom.xml
  8. Running "mvn verify" creates ./releng/org.ptolemy.tycho.update/target/repository/plugins/diva_11.0.0.201606291522.jar

In the osgi-2-0 Jenkins build, one of the steps publishes artifacts to a SSH site on moog. The contents of releng/org.ptolemy.tycho.update/target/** are copied to ~www/cvswww/chess.eecs.berkeley.edu/triq/. A symbolic link from ~www/cvswww/chess.eecs.berkeley.edu/triq/p2/osgi-2-0 to ../releng/org.ptolemy.tycho.update/target/repository was created.

Back to the top