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"

(Fix for mvn verify)
(Fixed GenerateHTMLTest problem)
Line 129: Line 129:
 
     </dependency>
 
     </dependency>
 
   </dependencies>
 
   </dependencies>
 +
</pre>
 +
 +
==== mvn verify fails because of GenerateHTMLTest===
 +
Running
 +
  mvn verify
 +
fails:
 +
<pre>
 +
[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)
 +
</pre>
 +
 +
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
 +
<pre>
 +
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"
 +
</pre>
 +
means that
 +
  mvn verify
 +
fails with
 +
<pre>
 +
[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')
 
</pre>
 
</pre>

Revision as of 19:47, 28 June 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

  • Ptolemy/Porting - more user friendly instructions about how to port Ptolemy actors to Triquetrum

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"

means that

 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')

Back to the top