Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Objectteams » OT/Equinox and Tycho
OT/Equinox and Tycho [message #962794] Mon, 29 October 2012 10:32 Go to next message
Kai Zimmermann is currently offline Kai ZimmermannFriend
Messages: 16
Registered: October 2012
Junior Member
I have looked the very good and simple example and tested it successfully (Wiki: Object_Teams_Quick-Start).
Then I wanted to compile the plugin with Tycho and read 2Between the Times" from objectteams blog.

But it didn't work.
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ OCEqui ---
[INFO] Compiling 1 source file to C:\Projekte\Java\SE\aktuelle\OCEqui\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] C:\Projekte\Java\SE\aktuelle\OCEqui\src\aspect\MyTeam.java:[3,0]
        import base org.eclipse.ui.internal.about.AboutItem;
                    ^^^^^^^^^^^^^^
The import org.eclipse.ui cannot be resolved
[ERROR] C:\Projekte\Java\SE\aktuelle\OCEqui\src\aspect\MyTeam.java:[7,0]
        protected class MyRole playedBy AboutItem {
                                        ^^^^^^^^^
AboutItem cannot be resolved to a type
2 problems (2 errors)
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project OCEqui: Compilation
 failure: Compilation failure:
[ERROR] C:\Projekte\Java\SE\aktuelle\OCEqui\src\aspect\MyTeam.java:[3,0]
[ERROR] import base org.eclipse.ui.internal.about.AboutItem;
[ERROR] ^^^^^^^^^^^^^^
[ERROR] The import org.eclipse.ui cannot be resolved
[ERROR] C:\Projekte\Java\SE\aktuelle\OCEqui\src\aspect\MyTeam.java:[7,0]
[ERROR] protected class MyRole playedBy AboutItem {
[ERROR] ^^^^^^^^^
[ERROR] AboutItem cannot be resolved to a type
[ERROR] 2 problems (2 errors)


Why didn't Tycho read the dependencies from the manifest.mf?


pom.xml
<project>

	<modelVersion>4.0.0</modelVersion>
	
	<parent>
    <groupId>org.eclipse</groupId>
    <artifactId>objectteams-parent-pom</artifactId>
    <version>2.1.0</version>
	</parent>

	<groupId>OCEqui</groupId>
	<artifactId>OCEqui</artifactId>
	<version>1.0.0-SNAPSHOT</version>
  <packaging>jar</packaging>
    
  <build>
    <sourceDirectory>src</sourceDirectory>
  </build>
  
  <repositories>
    <repository>
	    <id>ObjectTeamsRepository</id>
	    <name>Object Teams Repository</name>
	    <url>http://download.eclipse.org/objectteams/maven/3/repository</url>
    </repository>
  </repositories>
</project>


manifest.mf
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: OCEqui
Bundle-SymbolicName: OCEqui;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Require-Bundle: org.eclipse.objectteams.otequinox,
 org.eclipse.core.runtime,
 org.eclipse.ui.workbench


plugin.xml
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension
         point="org.eclipse.objectteams.otequinox.aspectBindings">
      <aspectBinding
            icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/calloutbinding_obj.gif">
         <basePlugin
               icon="platform:/plugin/org.eclipse.pde.ui/icons/obj16/plugin_obj.gif"
               id="org.eclipse.ui.workbench">
         </basePlugin>
         <team
               activation="ALL_THREADS"
               class="aspect.MyTeam"
               icon="platform:/plugin/org.eclipse.objectteams.otdt.ui/icons/ot/team_obj.gif">
         </team>
      </aspectBinding>
   </extension>

</plugin>
Re: OT/Equinox and Tycho [message #963342 is a reply to message #962794] Mon, 29 October 2012 18:51 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1036
Registered: July 2009
Senior Member
Kai Zimmermann wrote on Mon, 29 October 2012 11:32

Why didn't Tycho read the dependencies from the manifest.mf?


Before I try to reproduce I have a quick guess:
You seem to use Tycho only for binding the OT/J compiler, but your project is not actually a Tycho build because you declare a "jar" packaging.
Please try setting the packaging to s.t. like "eclipse-plugin" (see the Tycho documentation [1]).

Thanks for trying, it reminds me I should write a follow-up blog post describing how to build OT/Equinox bundles with Tycho Smile

best,
Stephan

[1] http://wiki.eclipse.org/Tycho/Packaging_Types
Re: OT/Equinox and Tycho [message #964313 is a reply to message #963342] Tue, 30 October 2012 12:27 Go to previous messageGo to next message
Kai Zimmermann is currently offline Kai ZimmermannFriend
Messages: 16
Registered: October 2012
Junior Member
thanks for the note, that's an error in the example. I have tried many combinations and then posted the wrong.

Maybe you have a example project, where I can look at the configuration?

maven.eclipse org/nexus or hudson.eclipse org/hudson/

[Updated on: Tue, 30 October 2012 12:48]

Report message to a moderator

Re: OT/Equinox and Tycho [message #964637 is a reply to message #964313] Tue, 30 October 2012 17:24 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1036
Registered: July 2009
Senior Member
You're right, the instructions in my blog are not much help for compiling OT/Equinox stuff using Tycho.
I'm working on an example and post it on my blog once I got it in a good shape,

please stay tuned,
Stephan
Re: OT/Equinox and Tycho [message #964819 is a reply to message #964637] Tue, 30 October 2012 20:31 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1036
Registered: July 2009
Senior Member
Alright, after some experimentation I got it to work.
I will update the parent pom and write about it in the blog but until all that is done you may try this:

Add another tweak into a pluginManagement.plugins section:
	<plugin>
		<groupId>org.eclipse.tycho</groupId>
		<artifactId>tycho-compiler-plugin</artifactId>
		<version>${tycho.version}</version>
		<extensions>true</extensions>
		<dependencies>
			<dependency>
				<groupId>org.eclipse.tycho</groupId>
				<artifactId>tycho-compiler-jdt</artifactId>
				<version>${tycho.version}</version>
				<exclusions>
					<!-- Exclude the original JDT/Core to be replaced by the OT/J variant: -->
					<exclusion>
						<groupId>org.eclipse.tycho</groupId>
						<artifactId>org.eclipse.jdt.core</artifactId>
					</exclusion>
				</exclusions>
			</dependency>
			<dependency>
				<!-- plug the OT/J compiler into the tycho-compiler-jdt plug-in: -->
				<groupId>org.eclipse</groupId>
				<artifactId>objectteams-otj-compiler</artifactId>
				<version>${otj.version}</version>
			</dependency>
		</dependencies>
	</plugin>


The difference to the existing parent pom being: now we're adapting tycho-compiler-jdt as a dependency of tycho-compiler-plugin instead of maven-compiler-plugin.

Now when you use the tycho-maven-plugin and packaging eclipse-plugin the tycho build will use the OT/J compiler.

In case that wasn't your problem, maybe you were missing a repository declaration? S.t. like:
	<repository>
		<id>Juno</id>
		<name>Eclipse Juno Repository</name>
		<url>http://download.eclipse.org/releases/juno</url>
		<layout>p2</layout>
	</repository>


With these bits I could build the OT/Equinox Quick-Start example.

HTH,
Stephan
Re: OT/Equinox and Tycho [message #964978 is a reply to message #964637] Tue, 30 October 2012 23:31 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1036
Registered: July 2009
Senior Member
Alright, here's the full story: http://blog.objectteams.org/2012/10/compiling-otequinox-projects-using-tycho/

And here's a shortcut to the fully configured example: http://wiki.eclipse.org/images/2/21/OTEquiTycho.zip

cheers,
Stephan
Re: OT/Equinox and Tycho [message #965521 is a reply to message #964978] Wed, 31 October 2012 09:52 Go to previous message
Lars Martin is currently offline Lars MartinFriend
Messages: 24
Registered: July 2009
Junior Member
Thanks Stephan, your blog post really helps a lot.
Previous Topic:Object Teams at JavaOne!
Next Topic:abstract with copy inheritance
Goto Forum:
  


Current Time: Sat Nov 29 00:27:56 GMT 2014

Powered by FUDForum. Page generated in 0.02212 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software