Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [recommenders-dev] [GSOC 2013] SnipEditor Weekly report

Hi Stefan,

> I ran into some problems this week.
> First of all, I wrote the tests
> using org.eclipselabs.xtext.utils.unittesting, which seemed very easy.
> But i could not add the dependency to maven. I've added the dependency
> and repository of org.eclipselabs.xtext.utils.unittesting in the .pom
> file from the test-project. It looks like this:
> <repositories>
>   <repository>
>       <id>eclipselabs</id>
>    
>  <url>http://xtext-utils.eclipselabs.org.codespot.com/git.distribution/releases/unittesting-0.9.x/</url>
>     
>    </repository>
>    </repositories>
>   <dependencies>
>   <dependency>
>   <groupId>org.eclipselabs.xtext.utils</groupId>
>   <artifactId>
>   org.eclipselabs.xtext.utils.unittesting
>   </artifactId>
>   <version>0.9.3.201204261440</version>
>   <scope>test</scope>
>   <optional>true</optional>
>   </dependency>
>   </dependencies>
> 
> Also, i set a plug-in repository in the main .pom :
> <pluginRepository>
>       <id>org.eclipselabs.xtext.utils.unittesting</id>
>    
>  <url>http://xtext-utils.eclipselabs.org.codespot.com/git.distribution/snapshots/unittesting-0.9.x/</url>
>    </pluginRepository>

OK, this should be unnecessary, as the dependency you rely on is not a
*Maven* plugin (like, e.g., tycho-maven-plugin) but an Eclipse plugin
aka OSGi bundle.

> ,but i keep getting the following error:
>  Failed to execute goal on project
> org.eclipse.recommenders.snipeditor.tests: Could not resolve
> dependencies for project
> org.eclipse.recommenders.snipeditor:org.eclipse.recommenders.snipeditor.tests:eclipse-test-plugin:1.0.0-SNAPSHOT:
> Failure to find
> org.eclipselabs.xtext.utils:org.eclipselabs.xtext.utils.unittesting:jar:0.9.3.201204261440
> in
> http://xtext-utils.eclipselabs.org.codespot.com/git.distribution/releases/unittesting-0.9.x/.
> I assume there is something wrong with the repository, but i cannot find
> any maven repository for this plug-in (searched for it on [1] and [2]).

Now, as to the reason why the dependency could not be found, it is
important to know that there are Maven repositories (like Maven central
and p2 repositories). These follow a different format -- and the one at
<http://xtext-utils.eclipselabs.org.codespot.com/git.distribution/releases/unittesting-0.9.x/>
is clearly a p2 repository, as indicated by the plugins/features
folders. (BTW, if you want to compare its structure with that of a Maven
repository, just have a look in your local ~/.m2/repository)

Now, by default Maven assumes that repositories declared through
<repository> have the default (Maven) layout. You have to tell it that
the repository uses the p2 layout. See the Tycho wiki for details [1].

You may also need to add <pomDependencies>consider</pomDependencies> to
your configuration of the target-platform-configuration plugin in
org.eclipse.recommenders.snipeditor.releng/pom.xml [2]. I'm bot entirely
sure about this, though. Maybe you can live without.

Hope that helps.

Andreas

[1]
<http://wiki.eclipse.org/Tycho/Reference_Card#Repository_providing_the_context_of_the_build>

[2]
<http://wiki.eclipse.org/Tycho/How_Tos/Dependency_on_pom-first_artifacts#What_happens_under_the_hood>

-- 
Codetrails UG (haftungsbeschränkt)
The knowledge transfer company

Robert-Bosch-Str. 7, 64293 Darmstadt
Mobile: +49-170-811-3791
http://www.codetrails.com/

Managing Director: Dr. Marcel Bruch
Handelsregister: Darmstadt HRB 91940


Back to the top