Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Problem with dependency resolution when running tests with Tycho surefire
  • From: "Tom Bryan (tombry)" <tombry@xxxxxxxxx>
  • Date: Wed, 23 Oct 2019 14:44:38 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cisco.com; dmarc=pass action=none header.from=cisco.com; dkim=pass header.d=cisco.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZFBDduwWiM9o2xowd2NyMw7iGA6HJKjLoNUxxbBvh9U=; b=jM5gcGda7/ToPvZszNJ0umOemWSVooG1AClL5yscBqYM4pIjlw+cGFR4JLQ6u3o6UnIgy2OWGpF0hX4qa87A+/w9z2542rlPMIJ9nqkCf/lVhGnLeWb30nOt6rVi6WULbxwVLDR7dUVGAMLNief8aw/jEahbtfaaXOUBvev8xhhGTl9qW1t/iYoDVG5Nf+4gJWPoWLaPRqywTkKKKmpPxLREx+DocwNVBACtkNZt15Bsr9rYc27vZEZhF9/tPFn3lXt304jZfoI/8fbS4t7Z17yy95O1OPPPW7NeScmiHwnhFl9ZSPGfTYcqBgfjUaUXN50ekq2j7NmlhauTAtIDHg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jI88mxypWEEoUNROwVhkN1pKYrI2SWBviPyOa1QelbvzclhrIAbBzIoinkr6Zm6/xCMsfYGTZwDWM5cJ3lERxVguRrktYroC02lEapzgEhfK2NHnTMFQRP0SVvrTOiH5QZ3MYs8hbo96NYCMWpFndPbQWJs/BmJRJ1lmWce4OJNBBFagUAPoanJ+viRUpKUMLjZndOL1Y2lyeoAb4CBWQyJFrSUpZTQ6UjpE1hry1CxaEshJXqrBv5hR29/NSxsUascFeEm8yJHuKdaThNPD+qMWh74ULz3/fo4XRqLQ6WgmJOhNDkSlMV8gh2k7oSe8n6bADocn8nHb5qs5ea3pbQ==
  • Delivered-to: tycho-user@xxxxxxxxxxx
  • Ironport-phdr: 9a23:kaFwxh+Wd7Z8ov9uRHGN82YQeigqvan1NQcJ650hzqhDabmn44+/bR7E/fs4iljPUM2b8P9Ch+fM+4HYEW0bqdfk0jgZdYBUERoMiMEYhQslVdKCDEfhPdbhbjcxG4JJU1o2t3w=
  • List-archive: <https://www.eclipse.org/mailman/private/tycho-user>
  • List-help: <mailto:tycho-user-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/tycho-user>, <mailto:tycho-user-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/tycho-user>, <mailto:tycho-user-request@eclipse.org?subject=unsubscribe>
  • Thread-index: AQHViGY6Iqp+r6uDU0a4guLTBk9pCqdnNMeAgACnmoCAADCMAA==
  • Thread-topic: [tycho-user] Problem with dependency resolution when running tests with Tycho surefire
  • User-agent: Microsoft-MacOutlook/10.10.f.191014

What happens if you run it once, skipping the tests and completing the install phase, and then run it again with the tests?

Caveat: I'm no longer the maintainer of my team's Tycho-based build, and this idea is coming from a dim and maybe faulty memory.  So maybe don't spend too much time on it.  :-)

I seem to remember hitting a problem like this years ago where where it seemed like one phase of the build was looking at the local modules but another phase was only finding the plugin JARs if they were installed in the local Maven cache.  That's why I suggested the 2-phase run, skipping the tests the first time above.  That'll tell you whether that's what's going on.  IIRC, I ended up solving it by following the model here: https://www.smartics.eu/confluence/display/BLOG/2013/07/22/Using+Aggregate+and+Parent+POMs.  

I see that plantuml has a similar set-up with releng/net.sourceforge.plantuml.parent and releng/net.sourceforge.plantuml.aggregator, but I'm not sure which pom.xml you're using when you kick off the build.  In my case, our aggregator pom.xml was the one that we passed to maven at the start of the build.

Also, not sure whether it matters, but in my case, the aggregator pom did not include the tests plugins in the modules.  That is, in my case, the file that looks like net.sourceforge.plantuml.aggregator/pom.xml only included the plugins, features, etc., that were actually part of the shipping product.  

But that may all be unrelated.  Like I said, I haven't had to troubleshoot Tycho builds in a couple of years!  You may be better off just following the advice here: https://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting.  Maybe there's a problem with your build's target platform.  Or maybe it just doesn't include what you think it does.  Or maybe you just need to add pomDependencies=consider to your tycho plugin <configuration>.

Good luck!
---Tom

On 10/23/19, 3:51 AM, "Hallvard Trætteberg" <hal@xxxxxxx> wrote:

    Tom,
    
    I'm working in a local branch where the bundle version is properly bumped. Also, wouldn't that kind of error surface during compilation? In this case the error occurs when launching the plugin test, as if resolution is different during test launch than compilation. The test requires the latest version of the "missing" imagecontrol bundle. I checked the generated jar and it contains a manifest with the correct version.
    
    Hallvard
    
    On 23/10/2019, 03:51, "Tom Bryan (tombry)" <tombry@xxxxxxxxx> wrote:
    
        Took a quick look, and it looks like the maintainer forgot to bump the Bundle-Version for the net.sourceforge.plantuml.eclipse.imagecontrol plug-in up to 1.1.24.qualifier.  Therefore, the build is only going to create version 1.2.23.
        
        See https://github.com/hallvard/plantuml/blob/master/bundles/net.sourceforge.plantuml.eclipse.imagecontrol/META-INF/MANIFEST.MF.  
        
        If you change that Bundle-Version to 1.1.24.qualifier and rebuild, I suspect that it'll work.
        
        Oddly, they bumped up the Bundle-Version for net.sourceforge.plantuml.jdt, but the Require-Bundle still only requires version 1.1.19 of the imagecontrol plug-in.  I suspect that that's also a mistake, but that's probably why the regular build does not get an error.  
        
        At least one test plug-in asks for version 1.2.24.qualifier of the imagecontrol plug-in, https://github.com/hallvard/plantuml/blob/master/tests/net.sourceforge.plantuml.eclipse.tests/META-INF/MANIFEST.MF, and the build is only going to create version 1.2.23.  That's why you're getting the error.
        
        ---Tom
        
        On 10/21/19, 7:21 PM, "tycho-user-bounces@xxxxxxxxxxx on behalf of Hallvard Trætteberg" <tycho-user-bounces@xxxxxxxxxxx on behalf of hal@xxxxxxx> wrote:
        
            Hi,
            
            I'm using Tycho to build plantuml (plugins, features and repository), and suddenly have started getting dependency resolution errors when running UI tests. I discovered it when upgrading to Tycho 1.5, and I'm pretty sure it worked with 1.3. However, when rolling back, I get the same errors. The build is pomless, with the Tycho version indicated in the .mvn/extensions.xml file. The target refers to Luna, i.e. a pretty old target, but it did work pretty recently. I tried upgrading to maven 3.6.2 (from 3.3), but needed to downgrade to 3.6.0. Here's the output of mvn --version:
            
            Apache Maven 3.5.4 (1edded0938998edf8bf061f1ceb3cfdeccf443fe; 2018-06-17T20:33:14+02:00)
            Maven home: /usr/local/Cellar/maven@3.5/3.5.4/libexec
            Java version: 1.8.0_222, vendor: Eclipse OpenJ9, runtime: /Users/hal/.sdkman/candidates/java/8.0.222.j9-adpt/jre
            Default locale: en_US, platform encoding: UTF-8
            OS name: "mac os x", version: "10.14.5", arch: "x86_64", family: "mac"
            
            The build consists of several ordinary plugins and test plugins. Compiling works, it's when running the (UI) tests with tycho-surefire, which is supposed to launch Eclipse, I get the dependency resolution error:
            
            [ERROR] Cannot resolve project dependencies:
            [ERROR]   Software being installed: net.sourceforge.plantuml.eclipse.tests 1.1.24.qualifier
            [ERROR]   Missing requirement: net.sourceforge.plantuml.eclipse.tests 1.1.24.qualifier requires 'osgi.bundle; net.sourceforge.plantuml.eclipse.imagecontrol 1.1.24.qualifier' but it could not be found
            
            The strange thing is that the missing dependency is to one of the plugins (net.sourceforge.plantuml.eclipse.imagecontrol) in the same build that resolved correctly during compilation. The build output for that plugin seems ok. There are no other dependency errors, I'm not sure how or if it would be reported if net.sourceforge.plantuml.eclipse.imagecontrol missed some dependencies. That imagecontrol plugin mainly depends on swt and jface, but as mentioned there are no messages about missing (transitive) dependencies. BTW, I have a dependency in the pom to the eclipse-feature org.eclipse.e4.rcp, but there is no reference to it in the build output.
            
            I've read the release notes for 1.4 and 1.5, and didn't see anything that should break the existing setup. I'm clueless to what to do, any suggestions?
            
            Regards,
            
            Hallvard
            ---
            Hallvard Trætteberg (hal@xxxxxxxxxxx)
            
            Associate Professor, ISSE group, Dept. of Computer Science at the 
            
            Norwegian University of Science and Technology
            
            _______________________________________________
            tycho-user mailing list
            tycho-user@xxxxxxxxxxx
            To change your delivery options, retrieve your password, or unsubscribe from this list, visit
            https://www.eclipse.org/mailman/listinfo/tycho-user
        
        
    
    


Back to the top