Return-Path: X-Original-To: apmail-maven-users-archive@www.apache.org Delivered-To: apmail-maven-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2A86018F0F for ; Mon, 23 Nov 2015 13:23:11 +0000 (UTC) Received: (qmail 78052 invoked by uid 500); 23 Nov 2015 13:23:10 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 77974 invoked by uid 500); 23 Nov 2015 13:23:10 -0000 Mailing-List: contact users-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Users List" Reply-To: "Maven Users List" Delivered-To: mailing list users@maven.apache.org Received: (qmail 77956 invoked by uid 99); 23 Nov 2015 13:23:09 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Nov 2015 13:23:09 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 0471B180A17 for ; Mon, 23 Nov 2015 13:23:09 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.801 X-Spam-Level: X-Spam-Status: No, score=0.801 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, KAM_ASCII_DIVIDERS=0.8, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=takari-io.20150623.gappssmtp.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id Gniy04PNSllo for ; Mon, 23 Nov 2015 13:22:57 +0000 (UTC) Received: from mail-io0-f173.google.com (mail-io0-f173.google.com [209.85.223.173]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id A4B0820FE7 for ; Mon, 23 Nov 2015 13:22:56 +0000 (UTC) Received: by iouu10 with SMTP id u10so189106918iou.0 for ; Mon, 23 Nov 2015 05:22:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=takari-io.20150623.gappssmtp.com; s=20150623; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=apynwAQ10+qPw2n8IMKAODwFQT8PmcURQfeehvx1nsc=; b=fG4KHorugBU0ArTWAytWO4Hv5OnGdkMho17xTF5AGvn+xTMSbRL/5MIq5KJQRMV6SI 0pwUdM6+Pqlkfbc0HeoktMEBpfzNiaReknRi7ny6OYODVenGBGPmLOIMZSLkPawJnJD2 6DH/Hss9fgut0xSO0MJu7Zp1ZSNOeyiYW3M6E/6rzTkzdZm79xCFOyq/PggUDuGA4TVZ /mNOr3J0qWLFmLtE+8MgsCT6cu1jPyI2cGANzuEPYecl/pgSkjYsIngKZ0Kkt6y0v8PX zlsEc+N4ev+Nuumk7Kw4QjGpeM6gq4f8L9obT+sjH2s/AHkgSL2qZ/XqlLRsEcMLPsd5 D01A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id:references:to; bh=apynwAQ10+qPw2n8IMKAODwFQT8PmcURQfeehvx1nsc=; b=OeY3a2CD5xA0muRfrvbGVpBQV1dDqMHtMe+f62DGiR2wburrIq7MB1H01SfSjrMLS6 w54GFkZ0GmYc5LW5UcP257b6Ilc5Ng5AWQTI6eQ432+VVtmrExaLQ4RYSXjMkSrV2A0u kY52u70zPRfQxa8StVS2BTdZPMwbw2uq0SO2mkdIicCcRxRdinc/dTUv6AaTiwmoZYSX JJiYPwlI8j2SWjVmLpRtUT23vhn8LhUPD6iczJj/PWTLxCpYnfk8nYquC6EuG/QYb1BQ en6kDRFRJjOi5BlcetAjPeL9NWGsKKawgrZlWxapTzWOLpCUERwvujL9FYThgYH0FrRL cDjQ== X-Gm-Message-State: ALoCoQlPTs+SIssv6vjqeh+IQ3WrsXY5+9ApZLRv7xODKsMEURb51yQBEtFp7xNd2o9z7lpf9Z1W X-Received: by 10.107.134.166 with SMTP id q38mr25605067ioi.25.1448284975398; Mon, 23 Nov 2015 05:22:55 -0800 (PST) Received: from [10.0.1.4] (206-132-53-193.eastlink.ca. [206.132.53.193]) by smtp.gmail.com with ESMTPSA id x1sm4968386igl.14.2015.11.23.05.22.53 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Nov 2015 05:22:54 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: Running tests using failsafe from a shaded jar? From: Jason van Zyl In-Reply-To: Date: Mon, 23 Nov 2015 08:22:51 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <407EC743-AC39-45B3-B332-E01C5C9D0D74@takari.io> References: To: Maven Users List X-Mailer: Apple Mail (2.2104) Mirko, You=E2=80=99ll notice if you look at the source that it=E2=80=99s a = JSR330 component. So there is a the sisu-maven-plugin which generates a = META-INF/sisu/javax.inject.Named as part of the build. You will want to = look in your shaded JAR and make sure you have one of those files, I=E2=80= =99m not certain if there is a resource transformer that deals with this = file so you might have to make one of those. I say might because it = depends on how you start up the container for Maven. If you don=E2=80=99t = particularly care about startup speed you can make the container scan = the classpath and it will create all the bindings from the classes in = the scan. By default in Maven we get the container to use the index file = cited above because it=E2=80=99s much faster at creating all the = bindings. Your error results from there being no binding for the = DefaultClassRealmManager so it=E2=80=99s likely not finding the = javax.inject.Named file. If you look at some of the test cases[1] in maven-core you=E2=80=99ll = see where the container is created and see how the scanning behaviour is = changed. To try something quickly you can just turn the classpath = scanning on and see if it=E2=80=99s fast enough. You might also have to = lift a few bits from the PlexusTestCase class itself but it=E2=80=99s = very similar to how the container if created in the MavenCli class which = also serves as an example. [1]: = https://github.com/apache/maven/blob/master/maven-core/src/test/java/org/a= pache/maven/AbstractCoreMavenComponentTestCase.java > On Nov 22, 2015, at 2:03 AM, Mirko Friedenhagen = wrote: >=20 > Hello Stephen, I will share how to do this in general. As it it not as = easy > as I hoped I will firstly extract a POC project and share that on = GitHub > immediately with the risk of never succeeding :-) >=20 > Regards > Mirko > --=20 > Sent from my mobile > Am 21.11.2015 23:34 schrieb "Stephen Connolly" < > stephen.alan.connolly@gmail.com>: >=20 >> If you get this working, any chance you could share your work? >>=20 >> On 21 November 2015 at 21:20, Mirko Friedenhagen = >> wrote: >>=20 >>> Hello, >>>=20 >>> I want to use to run tests on machine, where Maven is not installed >>> and access to a repository is not allowed. >>> However I want to (ab-)use the failsafe plugin so I may use the fine >>> machinery which allows to specify tests and get XML reports. >>>=20 >>> Using maven-embedded I created an App class which just runs >>> failsafe:integration tests, all dependencies are found in a shaded >>> jar. >>> I already used >>> = org.apache.maven.plugins.shade.resource.ComponentsXmlResourceTransformer >>> so a complete looking META-INF/plexus/components.xml is created. >>>=20 >>> When I start the jar with java -jar MY_SHADED_JAR.jar I always get = the >>> following error: >>>=20 >>> 22:09:57.365 [main] WARN Sisu - Error injecting: >>> org.apache.maven.project.DefaultProjectBuildingHelper >>>=20 >>> com.google.inject.ProvisionException: Unable to provision, see the >>> following errors: >>>=20 >>>=20 >>> 1) No implementation for = org.apache.maven.classrealm.ClassRealmManager >>> was bound. >>>=20 >>> while locating = org.apache.maven.project.DefaultProjectBuildingHelper >>>=20 >>>=20 >>> Looking into components.xml DefaultClassRealmManager is not there = but >>> is referenced twice. >>>=20 >>> Grepping through the components.xml files in a Maven installation, I >>> do not see where the DefaultClassRealmManager is instantiated. >>>=20 >>> Regards Mirko >>> -- >>> http://illegalstateexception.blogspot.com/ >>> https://github.com/mfriedenhagen/ (http://osrc.dfm.io/mfriedenhagen) >>> https://bitbucket.org/mfriedenhagen/ >>>=20 >>> = --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org >>> For additional commands, e-mail: users-help@maven.apache.org >>>=20 >>>=20 >>=20 Thanks, Jason ---------------------------------------------------------- Jason van Zyl Founder, Takari and Apache Maven http://twitter.com/jvanzyl http://twitter.com/takari_io --------------------------------------------------------- Simplex sigillum veri. (Simplicity is the seal of truth.) --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org For additional commands, e-mail: users-help@maven.apache.org