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>.
> 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.