Hello

I've debugged your `./gradlew test` and in this moment:

"Test worker@1428" prio=5 tid=0xf nid=NA runnable
  java.lang.Thread.State: RUNNABLE
 at
org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:576)
 at
org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:550)
 at
org.ops4j.pax.url.mvn.internal.Connection.getInputStream(Connection.java:123)
 at java.net.URL.openStream(URL.java:1067)
 at
org.ops4j.pax.exam.karaf.container.internal.ArchiveExtractor.extractZipDistribution(ArchiveExtractor.java:88)
 at
org.ops4j.pax.exam.karaf.container.internal.ArchiveExtractor.extract(ArchiveExtractor.java:67)
 at
org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer.start(KarafTestContainer.java:162)
 - locked <0xa7e> (a
org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer)
 at
org.ops4j.pax.exam.spi.reactors.EagerSingleStagedReactor.setUp(EagerSingleStagedReactor.java:86)
 at
org.ops4j.pax.exam.spi.reactors.EagerSingleStagedReactor.beforeClass(EagerSingleStagedReactor.java:136)
 at
org.ops4j.pax.exam.spi.reactors.ReactorManager.beforeClass(ReactorManager.java:457)
 at org.ops4j.pax.exam.junit.impl.ProbeRunner.run(ProbeRunner.java:97)
 at org.ops4j.pax.exam.junit.PaxExam.run(PaxExam.java:93)
 at
org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:110)
...
 at
org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
 at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
 at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 at
org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
 at java.lang.Thread.run(Thread.java:748)

The configuration was:

this = {org.ops4j.pax.url.mvn.internal.AetherBasedResolver@2624}
 LOG: org.slf4j.Logger  = {org.slf4j.impl.SimpleLogger@2636}
"org.slf4j.impl.SimpleLogger(org.ops4j.pax.url.mvn.internal.AetherBasedResolver)"
...
 m_repoSystem: shaded.org.eclipse.aether.RepositorySystem  =
{shaded.org.eclipse.aether.internal.impl.DefaultRepositorySystem@2646}
 m_config: org.ops4j.pax.url.mvn.internal.config.MavenConfiguration  =
{org.ops4j.pax.url.mvn.internal.config.MavenConfigurationImpl@2647}
...
  m_properties: java.util.Map  = {java.util.HashMap@2665}  size = 4
   "org.ops4j.pax.url.mvn.settings" -> {java.net.URL@2675}
"file:/home/ggrzybek/.m2/settings.xml"
   "org.ops4j.pax.url.mvn.security" ->
"/home/ggrzybek/.m2/settings-security.xml"
   "*org.ops4j.pax.url.mvn.useFallbackRepositories*" ->
{java.lang.Boolean@2679} *true*
   "org.ops4j.pax.url.mvn.timeout" -> {java.lang.Integer@2681} 5000

The problem is that your Karaf distro is downloaded by pax-url-aether
configured from Pax-Exam itself and there's not much you can do with
editConfigurationFilePut() here. Fortunately you can change the config
using system properties, so this is what I had to do to make your test
start correctly:

$ git diff
diff --git a/karaf/build.gradle b/karaf/build.gradle
index 9df0bca..0593823 100644
--- a/karaf/build.gradle
+++ b/karaf/build.gradle
@@ -86,6 +86,8 @@ test {

     // Uncomment to enable remote debugging of internal Karaf container on
port 5005
     //systemProperty "debug.remote", "true"
+    systemProperty "org.ops4j.pax.url.mvn.useFallbackRepositories", "false"
+    systemProperty "org.ops4j.pax.url.mvn.repositories", "
https://repo1.maven.org/maven2@id=central";

     // Uncomment to keep the deployed karaf container inside
build/exam/<uuid> for debugging.
     //systemProperty "debug.keepExam", "true"
diff --git a/karaf/src/test/java/ca/islandora/alpaca/karaf/KarafIT.java
b/karaf/src/test/java/ca/islandora/alpaca/karaf/KarafIT.java
index f1ef169..9711f27 100644
--- a/karaf/src/test/java/ca/islandora/alpaca/karaf/KarafIT.java
+++ b/karaf/src/test/java/ca/islandora/alpaca/karaf/KarafIT.java
@@ -102,7 +102,7 @@ public class KarafIT {
         return options(

 
frameworkProperty("org.ops4j.pax.url.mvn.requireConfigAdminConfig").value(true),
                 replaceConfigurationFile("etc/config.properties",
-                        new File("config.properties")
+                        new File("src/test/resources/config.properties")
                 ),
                 when( debugRemote ).useOptions(
                        debugConfiguration( "5005", true )

I'm not an expert of gradle (I don't even like it much ;), so you have to
check why the Karaf doesn't start. At least it's downloaded ;)

regards
Grzegorz Grzybek

czw., 5 mar 2020 o 22:24 Jean-Baptiste Onofré <[email protected]>
napisał(a):

> Not, this action is performed once karaf is downloaded and before started.
> Your problem here is when Pax Exam tries to download Karaf.
>
> The problem is in your pom.xml. Don't you a <repository/> section in your
> pom or parent pom ?
>
> Did you try to just add the correct <repository/> in your pom.xml ?
>
> Regards
> JB
>
> On Thu, Mar 5, 2020 at 9:56 PM Jared Whiklo <[email protected]> wrote:
>
>> I have this:
>>
>>
>> https://github.com/whikloj/Alpaca/blob/fix-pax-exam/karaf/src/test/java/ca/islandora/alpaca/karaf/KarafIT.java#L146-L150
>>
>> Is that correct?
>>
>> Because it is not being used to download apache-karaf and instead I
>> fallback to the http://repo1.maven.org/maven2 and get
>>
>> Caused by:
>>         java.io.IOException: Error resolving artifact
>> org.apache.karaf:apache-karaf:zip:4.0.6: Could not transfer artifact
>> org.apache.karaf:apache-karaf:zip:4.0.6 from/to central
>> (http://repo1.maven.org/maven2/): Failed to transfer file:
>>
>> http://repo1.maven.org/maven2/org/apache/karaf/apache-karaf/4.0.6/apache-karaf-4.0.6.zip
>> .
>> Return code is: 501 , ReasonPhrase:HTTPS Required.
>>
>> cheers,
>> jared
>>
>> On 2020-03-05 2:08 p.m., Jean-Baptiste Onofré wrote:
>> > Hi Jared,
>> >
>> > I mean that you can define the pax-url configuration in
>> > the @Configuration. It's where you can define the repositories URL,
>> > especially you have to use https for Central (it will be changed by
>> > default in Karaf 4.2.9):
>> >
>> >
>> https://github.com/apache/karaf/blob/master/itests/common/src/main/java/org/apache/karaf/itests/KarafTestSupport.java#L211
>> >
>> > Regards
>> > JB
>> >
>> > On Thu, Mar 5, 2020 at 8:38 PM Jared Whiklo <[email protected]
>> > <mailto:[email protected]>> wrote:
>> >
>> >     Sorry JB, I don't know what you mean by that?
>> >
>> >     Is this outside of the actual test? Is there a configuration file I
>> >     should have somewhere specific that defines this?
>> >
>> >     I am really quite a novice at Pax Exam stuff.
>> >
>> >     cheers,
>> >     jared
>> >
>> >     On 2020-03-05 1:32 p.m., Jean-Baptiste Onofré wrote:
>> >     > Why not simply update the pax url cfg file in the pax exam config
>> ?
>> >     >
>> >     > Regards
>> >     > JB
>> >     >
>> >     > Le jeu. 5 mars 2020 à 20:01, Jared Whiklo <[email protected]
>> >     <mailto:[email protected]>
>> >     > <mailto:[email protected] <mailto:[email protected]>>> a écrit :
>> >     >
>> >     >     Thank you Grzegorz,
>> >     >
>> >     >     Here is the test currently
>> >     >
>> >     >
>> >
>> https://github.com/whikloj/Alpaca/blob/fix-pax-exam/karaf/src/test/java/ca/islandora/alpaca/karaf/KarafIT.java
>> >     >
>> >     >     The only solution I have found is to change my personal maven
>> >     >     settings.xml to include a repository or mirror for Maven
>> central
>> >     >     with the https scheme.
>> >     >
>> >     >     But unfortunately that means anyone trying to build this also
>> >     >     requires that setup (and Travis-CI), which makes it seem like
>> >     it is
>> >     >     not the correct solution.
>> >     >
>> >     >     cheers,
>> >     >     jared
>> >     >
>> >     >     On Wednesday, 4 March 2020 23:48:12 UTC-6, Grzegorz Grzybek
>> wrote:
>> >     >
>> >     >         Hello
>> >     >
>> >     >         Can you share your failing test via Github? I run many
>> Karaf
>> >     >         Pax-Exam tests everyday...
>> >     >
>> >     >         regards
>> >     >         Grzegorz Grzybek
>> >     >
>> >     >     --
>> >     >     --
>> >     >     ------------------
>> >     >     OPS4J - http://www.ops4j.org - [email protected]
>> >     <mailto:[email protected]>
>> >     >     <mailto:[email protected] <mailto:[email protected]
>> >>
>> >     >
>> >     >     ---
>> >     >     You received this message because you are subscribed to the
>> Google
>> >     >     Groups "OPS4J" group.
>> >     >     To unsubscribe from this group and stop receiving emails from
>> it,
>> >     >     send an email to [email protected]
>> >     <mailto:ops4j%[email protected]>
>> >     >     <mailto:[email protected]
>> >     <mailto:ops4j%[email protected]>>.
>> >     >     To view this discussion on the web visit
>> >     >
>> >
>> https://groups.google.com/d/msgid/ops4j/97913dd1-3c66-4f64-87f5-1febc9d2a63d%40googlegroups.com
>> >     >
>> >      <
>> https://groups.google.com/d/msgid/ops4j/97913dd1-3c66-4f64-87f5-1febc9d2a63d%40googlegroups.com?utm_medium=email&utm_source=footer
>> >.
>> >     >
>> >     > --
>> >     > --
>> >     > ------------------
>> >     > OPS4J - http://www.ops4j.org - [email protected]
>> >     <mailto:[email protected]>
>> >     >
>> >     > ---
>> >     > You received this message because you are subscribed to a topic
>> in the
>> >     > Google Groups "OPS4J" group.
>> >     > To unsubscribe from this topic, visit
>> >     > https://groups.google.com/d/topic/ops4j/pJ98QaBVPfE/unsubscribe.
>> >     > To unsubscribe from this group and all its topics, send an email
>> to
>> >     > [email protected]
>> >     <mailto:ops4j%[email protected]>
>> >     > <mailto:[email protected]
>> >     <mailto:ops4j%[email protected]>>.
>> >     > To view this discussion on the web visit
>> >     >
>> >
>> https://groups.google.com/d/msgid/ops4j/CAB8EV3TxumiSJ1y-eDFeoXPvsJn_X3HWqfikSBmhWyrd%3DBXFFQ%40mail.gmail.com
>> >     >
>> >     <
>> https://groups.google.com/d/msgid/ops4j/CAB8EV3TxumiSJ1y-eDFeoXPvsJn_X3HWqfikSBmhWyrd%3DBXFFQ%40mail.gmail.com?utm_medium=email&utm_source=footer
>> >.
>> >
>> >     --
>> >     Jared Whiklo
>> >     Pronouns: he/him/his
>> >     [email protected] <mailto:[email protected]>
>> >     --------------------------------------------------
>> >     I've learned that you shouldn't compare yourself to others - they
>> are
>> >     more screwed up than you think.
>> >
>> >     --
>> >     --
>> >     ------------------
>> >     OPS4J - http://www.ops4j.org - [email protected]
>> >     <mailto:[email protected]>
>> >
>> >     ---
>> >     You received this message because you are subscribed to the Google
>> >     Groups "OPS4J" group.
>> >     To unsubscribe from this group and stop receiving emails from it,
>> >     send an email to [email protected]
>> >     <mailto:ops4j%[email protected]>.
>> >     To view this discussion on the web visit
>> >
>> https://groups.google.com/d/msgid/ops4j/97bebfae-5840-4b2c-e33c-0db7f2af472f%40gmail.com
>> .
>> >
>> > --
>> > --
>> > ------------------
>> > OPS4J - http://www.ops4j.org - [email protected]
>> >
>> > ---
>> > You received this message because you are subscribed to a topic in the
>> > Google Groups "OPS4J" group.
>> > To unsubscribe from this topic, visit
>> > https://groups.google.com/d/topic/ops4j/pJ98QaBVPfE/unsubscribe.
>> > To unsubscribe from this group and all its topics, send an email to
>> > [email protected]
>> > <mailto:[email protected]>.
>> > To view this discussion on the web visit
>> >
>> https://groups.google.com/d/msgid/ops4j/CAB8EV3S5ZODmZgDBao3O5FjUYyDTzyd24KMtvJRWxTNyunkKKg%40mail.gmail.com
>> > <
>> https://groups.google.com/d/msgid/ops4j/CAB8EV3S5ZODmZgDBao3O5FjUYyDTzyd24KMtvJRWxTNyunkKKg%40mail.gmail.com?utm_medium=email&utm_source=footer
>> >.
>>
>> --
>> Jared Whiklo
>> Pronouns: he/him/his
>> [email protected]
>> --------------------------------------------------
>> Age is a very high price to pay for maturity.
>>
>> --
>> --
>> ------------------
>> OPS4J - http://www.ops4j.org - [email protected]
>>
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "OPS4J" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ops4j/863de98e-c9ec-6071-ea4d-770f769f14d4%40gmail.com
>> .
>>
> --
> --
> ------------------
> OPS4J - http://www.ops4j.org - [email protected]
>
> ---
> You received this message because you are subscribed to the Google Groups
> "OPS4J" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ops4j/CAB8EV3RpHK97mJNsg12OKy6cXj-AUD8BbtZZ8w%2BwGBMORRo%3DYQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/ops4j/CAB8EV3RpHK97mJNsg12OKy6cXj-AUD8BbtZZ8w%2BwGBMORRo%3DYQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
-- 
------------------
OPS4J - http://www.ops4j.org - [email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ops4j/CAAdXmhpMHV12BmUjWzHLPMZMWj6gOwb%3DrP2ey%2BHUPPsdODRzJA%40mail.gmail.com.

Reply via email to