Archi Forum

Archi => Archi Development => Topic started by: Tom on March 09, 2017, 14:21:41 PM

Title: Custom plugin missing requirement on bundle com.archimatetool.editor
Post by: Tom on March 09, 2017, 14:21:41 PM
Hi everyone,

I'm currently working on a custom plugin for the Archimatetool.
I followed the guide on setting up the Eclipse environment (http://www.archimatetool.com/dev/running-archi (http://www.archimatetool.com/dev/running-archi)) using the release 3.3.2 on github (https://github.com/archimatetool/archi/releases/tag/release_3.3.2 (https://github.com/archimatetool/archi/releases/tag/release_3.3.2)).

I put both the archimatetool and my custom plugin in the same workspace.
As for the good news, running/debugging my project works perfectly fine !

The plugin is a maven project, but when trying to build it complains about not finding the archimatetool bundle.
[ERROR]   Missing requirement: requires 'bundle com.archimatetool.editor 0.0.0' but it could not be found

Is there anyway for me to make maven build my project ?

Thanks in advance!

Tom

Title: Re: Custom plugin missing requirement on bundle com.archimatetool.editor
Post by: Phil Beauvoir on March 09, 2017, 14:44:20 PM
Hi Tom,

it's hard to diagnose the problem without a lot more detail on the build configuration.

Phil
Title: Re: Custom plugin missing requirement on bundle com.archimatetool.editor
Post by: Tom on March 09, 2017, 15:24:48 PM
I'm using Eclipse Tycho maven plugin.
Here is the relevant part out of the pom.xml:


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

<build>
        <plugins>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-maven-plugin</artifactId>
                <version>${tycho.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <argLine>-Dbundle.running.mode=utest</argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-surefire-plugin</artifactId>
                <version>${tycho.version}</version>
                <configuration>
                    <argLine>-Dbundle.running.mode=utest</argLine>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>${maven.dependency.version}</version>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>lib/</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
...


Maven debug with the missing bundles:


[DEBUG] No solution found because the problem is unsatisfiable.: [Unable to satisfy dependency from eu.europa.ec.eira.cartool 1.0.0.qualifier to bundle com.archimatetool.editor 0.0.0.; Unable to satisfy dependency from eu.europa.ec.eira.cartool 1.0.0.qualifier to bundle com.archimatetool.model 0.0.0.; Unable to satisfy dependency from eu.europa.ec.eira.cartool 1.0.0.qualifier to bundle com.archimatetool.jdom 0.0.0.; Unable to satisfy dependency from eu.europa.ec.eira.cartool 1.0.0.qualifier to bundle com.archimatetool.widgets 0.0.0.; Unable to satisfy dependency from eu.europa.ec.eira.cartool 1.0.0.qualifier to package com.archimatetool.editor.views.tree 0.0.0.; No solution found because the problem is unsatisfiable.]


Title: Re: Custom plugin missing requirement on bundle com.archimatetool.editor
Post by: Hervé on March 09, 2017, 15:27:07 PM
Hi tom,

I do not know about Maven, but I had to add the com.archimatetool.editor in my plugin dependencies (plugin.xml).

Best regards
Hervé
Title: Re: Custom plugin missing requirement on bundle com.archimatetool.editor
Post by: Tom on March 09, 2017, 15:38:31 PM
I have them in my plugin dependencies too.

Title: Re: Custom plugin missing requirement on bundle com.archimatetool.editor
Post by: Phil Beauvoir on March 09, 2017, 15:42:02 PM
I'm not a maven expert, but it might be worth looking at the pom.xml files in each of Archi's plugins.
Title: Re: Custom plugin missing requirement on bundle com.archimatetool.editor
Post by: Tom on March 09, 2017, 15:48:08 PM
Tycho is unable to find the archimate bundles as shown in the error in the previous post.
Title: Re: Custom plugin missing requirement on bundle com.archimatetool.editor
Post by: Phil Beauvoir on March 09, 2017, 15:50:10 PM
Are you trying to build just your plugin? Or build all of Archi and your plugin? The way the pom.xml files are set up is to build all of the plugins and Archi.
Title: Re: Custom plugin missing requirement on bundle com.archimatetool.editor
Post by: Hervé on March 09, 2017, 15:57:18 PM
Just in case, could you please try to change the order of your dependencies ... I know the order is important (even if I can't explain why).

Please send the com.archimate.editor in second position.

Best regards
Hervé
Title: Re: Custom plugin missing requirement on bundle com.archimatetool.editor
Post by: Phil Beauvoir on March 09, 2017, 16:00:25 PM
All I can suggest is to take a look at some of the other plugins there, like the com.archimatetool.hammer one, and compare dependencies.
Title: Re: Custom plugin missing requirement on bundle com.archimatetool.editor
Post by: Tom on March 09, 2017, 16:04:50 PM
I'm just building the custom plugin, which is using archimate classes.

Moving the com.archimatetool.editor to second position did not help.
Title: Re: Custom plugin missing requirement on bundle com.archimatetool.editor
Post by: Hervé on March 09, 2017, 16:06:19 PM
ok, I know it helped for me ...

I can't help you more, I'm afraid ...
Title: Re: Custom plugin missing requirement on bundle com.archimatetool.editor
Post by: Tom on March 10, 2017, 10:16:50 AM
No problem, I'll keep searching.
Title: Re: Custom plugin missing requirement on bundle com.archimatetool.editor
Post by: Phil Beauvoir on March 10, 2017, 10:25:45 AM
Tom,

it's not clear to me what you are trying to do. Are you trying to just build your plugin, or are you trying to build Archi and your plugin for distribution? If the former you could just export the jar from Eclipse (can't remember the menu item atm). Do you really need a maven build?

Phil
Title: Re: Custom plugin missing requirement on bundle com.archimatetool.editor
Post by: Tom on March 10, 2017, 10:30:28 AM
I'm trying to build just the plugin.

Export via Eclipse is what I'm doing now, but this is only a temporary solution.
The maven build takes care of some environmental properties, which by exporting I have to do manually.
Title: Re: Custom plugin missing requirement on bundle com.archimatetool.editor
Post by: Phil Beauvoir on March 10, 2017, 10:37:31 AM
I can't help you much with maven, as that's not my level of expertise. There is a main pom.xml file at the root of all Archi projects and a child pom.xml file in each of the Archi plugins and they all link together as a set and with the same group id. Do you think if you follow that same pattern it would help?
Title: Re: Custom plugin missing requirement on bundle com.archimatetool.editor
Post by: Tom on March 10, 2017, 10:40:14 AM
I'm using Archi release 3.3.2, these are not maven projects as far as I can see.
Title: Re: Custom plugin missing requirement on bundle com.archimatetool.editor
Post by: Phil Beauvoir on March 10, 2017, 10:54:21 AM
They were added in a later build. They could still be useful to look at.