Maven Aether configuration

188 vistas
Ir al primer mensaje no leído

Jared Whiklo

no leída,
19 feb 2020, 4:52:49 p.m.19/2/2020
para OPS4J
Hi all,

I'm relatively new to Pax-Exam stuff, but have been using it to test deployment of some resources in a Karaf container. This was working until such time as the recent switch to required SSL for maven central. So I need to switch out any default repositories urls from "http://repo1.maven.org/maven2/" to "https://repo1.maven.org/maven2/".

Currently we are getting the error

-----
Gradle Test Run :islandora-karaf:test > Gradle Test Executor 31 > ca.islandora.alpaca.karaf.KarafIT > classMethod FAILED
    java.lang.RuntimeException: Problem starting container

        Caused by:
        java.io.IOException: Error resolving artifact org.apache.karaf:apache-karaf:jar:zip:4.0.6: Could not transfer artifact org.apache.karaf:apache-karaf:jar: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.jar. Return code is: 501 , ReasonPhrase:HTTPS Required.

Gradle Test Run :islandora-karaf:test > Gradle Test Executor 31 > ca.islandora.alpaca.karaf.KarafIT > executionError FAILED
    java.lang.RuntimeException: Container never came up
----

I'm trying to set either the "org.ops4j.pax.url.mvn.repositories" or "org.ops4j.pax.url.mvn.settings" property. I have tried using the CoreOptions.systemProperty and CoreOptions.frameworkProperty but neither is used by the AetherBasedResolver class and instead it seems to fallback to...my maven settings?

The only thing that has worked was to add a <mirror></mirror> to my local ~/.m2/settings.xml for central. But this seems very user specific.

The test class can be found here

I feel like there something obvious I am missing here, any help is appreciated.

cheers,
jared

Oliver Lietz

no leída,
19 feb 2020, 5:09:30 p.m.19/2/2020
para op...@googlegroups.com
On Wednesday, February 19, 2020 10:52:49 PM CET Jared Whiklo wrote:
> Hi all,

Hi Jared,
No, I fixed it just yesterday for 4.x by upgrading Pax URL.
New release is outstanding.

Regards,
O.

> cheers,
> jared



Jared Whiklo

no leída,
20 feb 2020, 12:19:19 p.m.20/2/2020
para op...@googlegroups.com
Thanks Oliver, I'll watch for the release.
--
Jared Whiklo
Pronouns: he/him/his
jwh...@gmail.com
--------------------------------------------------
People are more violently opposed to fur than leather because it's safer
to harass rich women than motorcycle gangs.

signature.asc

Jared Whiklo

no leída,
27 feb 2020, 2:12:44 p.m.27/2/2020
para OPS4J
Coming back to this post 4.13.2 release and I'm clearly missing something and am still getting

Gradle Test Run :islandora-karaf:test > Gradle Test Executor 13 > ca.islandora.alpaca.karaf.KarafIT > classMethod FAILED

    java.lang.RuntimeException: Problem starting container

        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.

Gradle Test Run :islandora-karaf:test > Gradle Test Executor 13 > ca.islandora.alpaca.karaf.KarafIT > executionError FAILED

    java.lang.RuntimeException: Container never came up

I tried to add and return additional options() in the config() method, but because the failure is occurring while trying to download the Karaf container for the test, I feel like it must not be using any of those settings.

So I tried to setup a test-settings.xml file which defined a profile with a repository for Maven using the https URL, and have it activeByDefault. Then I tried to set this and via the

final String settingsLocation = getClass().getClassLoader().getResource("test-settings.xml").getPath();
systemProperty("org.ops4j.pax.url.mvn.settings").value(settingsLocation);

But this also did not have any effect.

So I tried

systemProperty("org.ops4j.pax.url.mvn.useFallbackRepositories").value("false");
systemProperty("org.ops4j.pax.url.mvn.repositories")
.value("https://repo1.maven.org/maven2@id=central");

Which also didn't have any effect.

Can someone explain where to set the settings explained on this page (https://ops4j1.jira.com/wiki/spaces/paxurl/pages/3833866/Mvn+Protocol) so that they are used when interpreting the karafDistributionConfiguration() and/or frameworkUrl() please?

cheers,
jared

Grzegorz Grzybek

no leída,
28 feb 2020, 1:30:56 a.m.28/2/2020
para op...@googlegroups.com
Hello

Both org.ops4j.pax.url.mvn.useFallbackRepositories and org.ops4j.pax.url.mvn.repositories properties are OK, but only if you specify them in org.ops4j.pax.url.mvn PID (ConfigAdmin) or context property (in Pax-Exam - frameworkProperty()).

There's additional _context property_ (framework property, in Karaf - etc/config.properties) "org.ops4j.pax.url.mvn.requireConfigAdminConfig" - with this set (to any value), pax-url-aether will synchronously wait for proper ConfigurationAdmin (otherwise it _could_ fallback to default configuration).

I hope this will help.

regards
Grzegorz Grzybek

--
--
------------------
OPS4J - http://www.ops4j.org - op...@googlegroups.com

---
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 ops4j+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ops4j/a9670011-f1ef-4f41-aadb-59dbaf0876ef%40googlegroups.com.

Jared Whiklo

no leída,
28 feb 2020, 1:11:08 p.m.28/2/2020
para op...@googlegroups.com
I tried adding a file containing

--------
org.ops4j.pax.url.mvn.repositories=https://repo1.maven.org/maven2@id=central
org.ops4j.pax.url.mvn.useFallbackRepositories=false
org.ops4j.pax.url.mvn.requireConfigAdminConfig=true
--------

and using the below as the start (but not complete) return from the
config() method

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

karafDistributionConfiguration()
.frameworkUrl(
maven()
.groupId("org.apache.karaf")
.artifactId("apache-karaf")
.version(karafVersion)
.type("zip")
)
.karafVersion(karafVersion)
.unpackDirectory(new File("build/exam"))
.useDeployFolder(false),
when( debugExam ).useOptions(
keepRuntimeFolder()
),
--------

It still fails, I think because all of these configuration settings
assume I have Karaf installed. But the failure is in downloading the
test container.

I tell it make the frameworkUrl using Maven,

.frameworkUrl(
maven()
.groupId("org.apache.karaf")
.artifactId("apache-karaf")
.version(karafVersion)
.type("zip")
)

which calls the ArchiveExtractor

https://github.com/ops4j/org.ops4j.pax.exam2/blob/master/containers/pax-exam-container-karaf/src/main/java/org/ops4j/pax/exam/karaf/container/internal/ArchiveExtractor.java#L88

which call openStream(), openStream() (part of java.net)

public final InputStream openStream() throws java.io.IOException {
return openConnection().getInputStream();
}

uses openConnection(), which is overridden to use the MavenResolver

https://github.com/ops4j/org.ops4j.pax.url/blob/master/pax-url-aether/src/main/java/org/ops4j/pax/url/mvn/Handler.java#L48

but passes a null in as system properties.

https://github.com/ops4j/org.ops4j.pax.url/blob/master/pax-url-aether/src/main/java/org/ops4j/pax/url/mvn/MavenResolvers.java#L27-L29

So then it passes in a propertyResolver that has no properties and just
the fallbackResolver (which contains http://repo1.maven.org/maven1)

propertyResolver = {DictionaryPropertyResolver@2189}
- m_properties = null
- m_fallbackResolver = {PropertiesPropertyResolver@2192}


So I guess what I need to do is manually build the correct Maven URL and
pass that directly in to the frameworkUrl() function?

cheers,
jared

On 2020-02-28 12:30 a.m., Grzegorz Grzybek wrote:
> Hello
>
> Both org.ops4j.pax.url.mvn.useFallbackRepositories and
> org.ops4j.pax.url.mvn.repositories properties are OK, but only if you
> specify them in org.ops4j.pax.url.mvn PID (ConfigAdmin) or context
> property (in Pax-Exam - frameworkProperty()).
>
> There's additional _context property_ (framework property, in Karaf -
> etc/config.properties) "org.ops4j.pax.url.mvn.requireConfigAdminConfig"
> - with this set (to any value), pax-url-aether will synchronously wait
> for proper ConfigurationAdmin (otherwise it _could_ fallback to default
> configuration).
>
> I hope this will help.
>
> regards
> Grzegorz Grzybek
>
> czw., 27 lut 2020 o 20:12 Jared Whiklo <jwh...@gmail.com
> <mailto:jwh...@gmail.com>> napisał(a):
> <mailto:op...@googlegroups.com>
>
> ---
> 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 ops4j+un...@googlegroups.com
> <mailto:ops4j+un...@googlegroups.com>.
> <https://groups.google.com/d/msgid/ops4j/a9670011-f1ef-4f41-aadb-59dbaf0876ef%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> --
> ------------------
> OPS4J - http://www.ops4j.org - op...@googlegroups.com
>
> ---
> 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
> ops4j+un...@googlegroups.com
> <mailto:ops4j+un...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ops4j/CAAdXmhrJ8AGVCg032THLx-oWeTaVHmd-XGiRi-bfNHBVDQHvBQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/ops4j/CAAdXmhrJ8AGVCg032THLx-oWeTaVHmd-XGiRi-bfNHBVDQHvBQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.

--
Jared Whiklo
Pronouns: he/him/his
jwh...@gmail.com
--------------------------------------------------
I drive way too fast to worry about cholesterol.

signature.asc

Jared Whiklo

no leída,
4 mar 2020, 4:40:39 p.m.4/3/2020
para OPS4J
So I went ahead and modified the test to have a hardcoded maven URL for the apache-karaf artifact.

final String karafDistributionUrl = "https://repo1.maven.org/maven2/org/apache/karaf/apache-karaf/" +
karafVersion + "/apache-karaf-" + karafVersion + ".zip";

But the ArchiveExtractor doesn't like ".zip" unless you are using a "file://" scheme. It does like "/zip" with "http" but I'm not sure how to use that as the actual URL doesn't have a "/zip" included?

So I tried switching "https" for "file" anyways. It took a long time to fail, but eventually it did with a Connection timeout.

At this point I'm stumped and wondering how other people are using Pax-Exam? Is it just the Karaf test container setup that is broken?


If anyone has a suggestion please send it along

cheers
,
jared

Grzegorz Grzybek

no leída,
5 mar 2020, 12:48:12 a.m.5/3/2020
para op...@googlegroups.com
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 - op...@googlegroups.com

---
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 ops4j+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ops4j/782d8fb8-2104-4f7e-aa7d-d2b2659121de%40googlegroups.com.

Jean-Baptiste Onofré

no leída,
5 mar 2020, 1:42:14 a.m.5/3/2020
para op...@googlegroups.com
Hi

Sorry I jump late on this thread. 

I don’t have any problem in Karaf (we have bunch of tests running daily without problem). 

I guess you are on Windows platform right ? Which jdk version ?

Anything special about network (like a proxy to access Internet) ?

Regards 
JB

--
--
------------------
OPS4J - http://www.ops4j.org - op...@googlegroups.com

---
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 ops4j+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ops4j/782d8fb8-2104-4f7e-aa7d-d2b2659121de%40googlegroups.com.

Jared Whiklo

no leída,
5 mar 2020, 2:01:02 p.m.5/3/2020
para OPS4J
Thank you Grzegorz,

Here is the test currently


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

Jared Whiklo

no leída,
5 mar 2020, 2:04:48 p.m.5/3/2020
para OPS4J
No need to worry about jumping in late, I'm still missing what I am doing wrong so any help is appreciated.

I am on OSX, but our Travis CI testing infrastructure is Ubuntu.

We are using Java 8 still.

I think (but don't know) this is a maven configuration problem, amplified by the fact that we use Gradle.

As I mentioned in my reply to Grzegorz, if I alter my Maven settings.xml to add a repository with the correct https address for maven then this test passes. I want to set that property on the test so it is not reliant on my maven configuration, but I can't seem to get the correct property set.

As I said, any hints or suggestions are appreciated.

cheers,
jared

On Thursday, 5 March 2020 00:42:14 UTC-6, Jean-Baptiste Onofré wrote:
Hi

Sorry I jump late on this thread. 

I don’t have any problem in Karaf (we have bunch of tests running daily without problem). 

I guess you are on Windows platform right ? Which jdk version ?

Anything special about network (like a proxy to access Internet) ?

Regards 
JB
Le mer. 4 mars 2020 à 22:40, Jared Whiklo <jwh...@gmail.com> a écrit :
So I went ahead and modified the test to have a hardcoded maven URL for the apache-karaf artifact.

final String karafDistributionUrl = "https://repo1.maven.org/maven2/org/apache/karaf/apache-karaf/" +
karafVersion + "/apache-karaf-" + karafVersion + ".zip";

But the ArchiveExtractor doesn't like ".zip" unless you are using a "file://" scheme. It does like "/zip" with "http" but I'm not sure how to use that as the actual URL doesn't have a "/zip" included?

So I tried switching "https" for "file" anyways. It took a long time to fail, but eventually it did with a Connection timeout.

At this point I'm stumped and wondering how other people are using Pax-Exam? Is it just the Karaf test container setup that is broken?


If anyone has a suggestion please send it along

cheers
,
jared

--
--
------------------
OPS4J - http://www.ops4j.org - op...@googlegroups.com

---
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 op...@googlegroups.com.

Jean-Baptiste Onofré

no leída,
5 mar 2020, 2:32:54 p.m.5/3/2020
para op...@googlegroups.com
Why not simply update the pax url cfg file in the pax exam config ?

Regards 
JB

--
--
------------------
OPS4J - http://www.ops4j.org - op...@googlegroups.com

---
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 ops4j+un...@googlegroups.com.

Jared Whiklo

no leída,
5 mar 2020, 2:38:33 p.m.5/3/2020
para op...@googlegroups.com
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 <jwh...@gmail.com
> <mailto:jwh...@gmail.com>> 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 - op...@googlegroups.com
> <mailto:op...@googlegroups.com>
>
> ---
> 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 ops4j+un...@googlegroups.com
> <mailto:ops4j+un...@googlegroups.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 - op...@googlegroups.com
>
> ---
> 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
> ops4j+un...@googlegroups.com
> <mailto:ops4j+un...@googlegroups.com>.
> 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
jwh...@gmail.com
--------------------------------------------------
I've learned that you shouldn't compare yourself to others - they are
more screwed up than you think.

signature.asc

Jean-Baptiste Onofré

no leída,
5 mar 2020, 3:08:46 p.m.5/3/2020
para OPS4J
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):


Regards
JB

To unsubscribe from this group and stop receiving emails from it, send an email to ops4j+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ops4j/97bebfae-5840-4b2c-e33c-0db7f2af472f%40gmail.com.

Jared Whiklo

no leída,
5 mar 2020, 3:36:35 p.m.5/3/2020
para op...@googlegroups.com
Right and the problem we are facing is that Central is now forcing us to
use "https" to do this step

https://github.com/apache/karaf/blob/master/itests/common/src/main/java/org/apache/karaf/itests/KarafTestSupport.java#L177

and instead the fallback repository that pax url aether resolver is
using are still "http://repo1.maven.org/maven2".

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 <jwh...@gmail.com
> <mailto:jwh...@gmail.com>> 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 <jwh...@gmail.com
> <mailto:jwh...@gmail.com>
> > <mailto:jwh...@gmail.com <mailto:jwh...@gmail.com>>> 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 - op...@googlegroups.com
> <mailto:op...@googlegroups.com>
> >     <mailto:op...@googlegroups.com <mailto:op...@googlegroups.com>>
> >
> >     ---
> >     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 ops4j+un...@googlegroups.com
> <mailto:ops4j%2Bunsu...@googlegroups.com>
> >     <mailto:ops4j+un...@googlegroups.com
> <mailto:ops4j%2Bunsu...@googlegroups.com>>.
> <mailto:op...@googlegroups.com>
> >
> > ---
> > 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
> > ops4j+un...@googlegroups.com
> <mailto:ops4j%2Bunsu...@googlegroups.com>
> > <mailto:ops4j+un...@googlegroups.com
> <mailto:ops4j%2Bunsu...@googlegroups.com>>.
> jwh...@gmail.com <mailto:jwh...@gmail.com>
> --------------------------------------------------
> I've learned that you shouldn't compare yourself to others - they are
> more screwed up than you think.
>
> --
> --
> ------------------
> OPS4J - http://www.ops4j.org - op...@googlegroups.com
> <mailto:op...@googlegroups.com>
>
> ---
> 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 ops4j+un...@googlegroups.com
> <mailto:ops4j%2Bunsu...@googlegroups.com>.
> 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 - op...@googlegroups.com
>
> ---
> 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
> ops4j+un...@googlegroups.com
> <mailto:ops4j+un...@googlegroups.com>.
> 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
jwh...@gmail.com
--------------------------------------------------
Not one shred of evidence supports the notion that life is serious.

signature.asc

Jared Whiklo

no leída,
5 mar 2020, 3:56:49 p.m.5/3/2020
para op...@googlegroups.com
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 <jwh...@gmail.com
> <mailto:jwh...@gmail.com>> 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 <jwh...@gmail.com
> <mailto:jwh...@gmail.com>
> > <mailto:jwh...@gmail.com <mailto:jwh...@gmail.com>>> 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 - op...@googlegroups.com
> <mailto:op...@googlegroups.com>
> >     <mailto:op...@googlegroups.com <mailto:op...@googlegroups.com>>
> >
> >     ---
> >     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 ops4j+un...@googlegroups.com
> <mailto:ops4j%2Bunsu...@googlegroups.com>
> >     <mailto:ops4j+un...@googlegroups.com
> <mailto:ops4j%2Bunsu...@googlegroups.com>>.
> <mailto:op...@googlegroups.com>
> >
> > ---
> > 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
> > ops4j+un...@googlegroups.com
> <mailto:ops4j%2Bunsu...@googlegroups.com>
> > <mailto:ops4j+un...@googlegroups.com
> <mailto:ops4j%2Bunsu...@googlegroups.com>>.
> jwh...@gmail.com <mailto:jwh...@gmail.com>
> --------------------------------------------------
> I've learned that you shouldn't compare yourself to others - they are
> more screwed up than you think.
>
> --
> --
> ------------------
> OPS4J - http://www.ops4j.org - op...@googlegroups.com
> <mailto:op...@googlegroups.com>
>
> ---
> 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 ops4j+un...@googlegroups.com
> <mailto:ops4j%2Bunsu...@googlegroups.com>.
> 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 - op...@googlegroups.com
>
> ---
> 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
> ops4j+un...@googlegroups.com
> <mailto:ops4j+un...@googlegroups.com>.
> 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
jwh...@gmail.com
--------------------------------------------------
Age is a very high price to pay for maturity.

signature.asc

Jean-Baptiste Onofré

no leída,
5 mar 2020, 4:24:09 p.m.5/3/2020
para OPS4J
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

To unsubscribe from this group and stop receiving emails from it, send an email to ops4j+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ops4j/863de98e-c9ec-6071-ea4d-770f769f14d4%40gmail.com.

Grzegorz Grzybek

no leída,
6 mar 2020, 8:03:46 a.m.6/3/2020
para op...@googlegroups.com
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

Jared Whiklo

no leída,
6 mar 2020, 11:17:48 a.m.6/3/2020
para op...@googlegroups.com
Thank you Grzegorz, that helps alot.

I can work through the rest now that I know that systemProperty() will
have the necessary effect.

cheers,
jared
>    "*org.ops4j.pax.url.mvn.useFallbackRepositories*" ->
> {java.lang.Boolean@2679} *true*
> <jeanbapti...@gmail.com <mailto:jeanbapti...@gmail.com>>
> >     <mailto:ops4j%2Bunsu...@googlegroups.com
> <mailto:ops4j%252Buns...@googlegroups.com>>
> >     >     <mailto:ops4j+un...@googlegroups.com
> <mailto:ops4j%2Bunsu...@googlegroups.com>
> >     <mailto:ops4j%2Bunsu...@googlegroups.com
> <mailto:ops4j%252Buns...@googlegroups.com>>>.
> >     >     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 - op...@googlegroups.com
> <mailto:op...@googlegroups.com>
> >     <mailto:op...@googlegroups.com
> <mailto:op...@googlegroups.com>>
> >     >
> >     > ---
> >     > 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
> >     > ops4j+un...@googlegroups.com
> <mailto:ops4j%2Bunsu...@googlegroups.com>
> >     <mailto:ops4j%2Bunsu...@googlegroups.com
> <mailto:ops4j%252Buns...@googlegroups.com>>
> >     > <mailto:ops4j+un...@googlegroups.com
> <mailto:ops4j%2Bunsu...@googlegroups.com>
> >     <mailto:ops4j%2Bunsu...@googlegroups.com
> <mailto:ops4j%252Buns...@googlegroups.com>>>.
> >     > 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
> >     jwh...@gmail.com <mailto:jwh...@gmail.com>
> <mailto:jwh...@gmail.com <mailto:jwh...@gmail.com>>
> >     --------------------------------------------------
> >     I've learned that you shouldn't compare yourself to others
> - they are
> >     more screwed up than you think.
> >
> >     --
> >     --
> >     ------------------
> >     OPS4J - http://www.ops4j.org - op...@googlegroups.com
> <mailto:op...@googlegroups.com>
> >     <mailto:op...@googlegroups.com
> <mailto:op...@googlegroups.com>>
> >
> >     ---
> >     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 ops4j+un...@googlegroups.com
> <mailto:ops4j%2Bunsu...@googlegroups.com>
> >     <mailto:ops4j%2Bunsu...@googlegroups.com
> <mailto:ops4j%252Buns...@googlegroups.com>>.
> >     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 - op...@googlegroups.com
> <mailto:op...@googlegroups.com>
> >
> > ---
> > 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
> > ops4j+un...@googlegroups.com
> <mailto:ops4j%2Bunsu...@googlegroups.com>
> > <mailto:ops4j+un...@googlegroups.com
> <mailto:ops4j%2Bunsu...@googlegroups.com>>.
> > To view this discussion on the web visit
> >
> jwh...@gmail.com <mailto:jwh...@gmail.com>
> --------------------------------------------------
> Age is a very high price to pay for maturity.
>
> --
> --
> ------------------
> OPS4J - http://www.ops4j.org - op...@googlegroups.com
> <mailto:op...@googlegroups.com>
>
> ---
> 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 ops4j+un...@googlegroups.com
> <mailto:ops4j%2Bunsu...@googlegroups.com>.
> To view this discussion on the web visit
> <mailto:op...@googlegroups.com>
>
> ---
> 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 ops4j+un...@googlegroups.com
> <mailto:ops4j+un...@googlegroups.com>.
> 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 - op...@googlegroups.com
>
> ---
> 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
> ops4j+un...@googlegroups.com
> <mailto:ops4j+un...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ops4j/CAAdXmhpMHV12BmUjWzHLPMZMWj6gOwb%3DrP2ey%2BHUPPsdODRzJA%40mail.gmail.com
> <https://groups.google.com/d/msgid/ops4j/CAAdXmhpMHV12BmUjWzHLPMZMWj6gOwb%3DrP2ey%2BHUPPsdODRzJA%40mail.gmail.com?utm_medium=email&utm_source=footer>.

--
Jared Whiklo
Pronouns: he/him/his
jwh...@gmail.com
--------------------------------------------------
A soldier will fight long and hard for a bit of coloured ribbon. --
Napoleon Boneparte

signature.asc

Grzegorz Grzybek

no leída,
6 mar 2020, 11:18:43 a.m.6/3/2020
para op...@googlegroups.com
You're welcome ;) Have a good weekend!

~Grzegorz

To unsubscribe from this group and stop receiving emails from it, send an email to ops4j+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ops4j/54cfb401-8c81-fef1-370c-ea100f1e6d2e%40gmail.com.
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos