Discussion:
[tycho-user] Using a P2 repository (as target) hosted on Amazon S3
Stéphane Vaucher
2018-05-22 13:31:32 UTC
Permalink
Hi everyone,

To support some builds done on AWS, I tried to set up an S3 bucket to host
a repository that I would like to use within my tycho target (READ, not
WRITE).
Here's an example on how to do things using pure MVN.

https://jmchung.github.io/blog/2015/03/01/using-amazon-s3-as-a-private-maven-repository/

We are able to deploy our application to S3. Additionally, when we access
the repository using HTTP, it works fine, but we'd like to avoid a public
access to some of our repositories. So we set-up kuali wagon and got the
following error:

[ERROR] Internal error: java.lang.RuntimeException: Invalid repository URL:
s3://com.castortech.repository/zk-8.5.0.tempfix/: unknown protocol: s3 ->
[Help 1]
org.apache.maven.InternalErrorException: Internal error:
java.lang.RuntimeException: Invalid repository URL:
s3://com.castortech.repository/zk-8.5.0.tempfix/
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:121)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.RuntimeException: Invalid repository URL:
s3://com.castortech.repository/zk-8.5.0.tempfix/
at
org.eclipse.tycho.p2.resolver.P2DependencyResolver.addEntireP2RepositoryToTargetPlatform(P2DependencyResolver.java:308)
at
org.eclipse.tycho.p2.resolver.P2DependencyResolver.computePreliminaryTargetPlatform(P2DependencyResolver.java:212)
at
org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject(DefaultTychoResolver.java:109)
at
org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:95)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:266)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
... 11 more
Caused by: java.net.MalformedURLException: unknown protocol: s3
at java.net.URL.<init>(URL.java:600)
at java.net.URL.<init>(URL.java:490)
at java.net.URL.<init>(URL.java:439)
at
org.eclipse.tycho.p2.resolver.P2DependencyResolver.addEntireP2RepositoryToTargetPlatform(P2DependencyResolver.java:302)
... 17 more


I tried registering Wagon
<build>
<extensions>
<extension>
<groupId>org.kuali.maven.wagons</groupId>
<artifactId>maven-s3-wagon</artifactId>
<version>[S3 Wagon Version]</version>
</extension>
</extensions>
</build>
As per: https://github.com/jcaddel/maven-s3-wagon/wiki/Usage

In:
https://github.com/eclipse/tycho/blob/master/tycho-p2/tycho-p2-facade/src/main/java/org/eclipse/tycho/p2/resolver/P2DependencyResolver.java

The error pops up when we try to generate a URL to then transform it into a
URI. Do you know if there's anything I'm missing or is what I'm doing
simply unsupported?

Regards,
Stephane
Johan Compagner
2018-05-22 13:50:48 UTC
Permalink
why use the s3 protocol? because then you do need all kind of AWS maven
plugins
i tried that and they are all horrible

if you have a bucket you also have just http access to it.. so i would use
the normal http url to that p2 repo
We have a few of those on s3 and that is working fine
Post by Stéphane Vaucher
Hi everyone,
To support some builds done on AWS, I tried to set up an S3 bucket to host
a repository that I would like to use within my tycho target (READ, not
WRITE).
Here's an example on how to do things using pure MVN.
https://jmchung.github.io/blog/2015/03/01/using-amazon-s3-as-a-private-maven-repository/
We are able to deploy our application to S3. Additionally, when we access
the repository using HTTP, it works fine, but we'd like to avoid a public
access to some of our repositories. So we set-up kuali wagon and got the
[ERROR] Internal error: java.lang.RuntimeException: Invalid repository
URL: s3://com.castortech.repository/zk-8.5.0.tempfix/: unknown protocol: s3
-> [Help 1]
s3://com.castortech.repository/zk-8.5.0.tempfix/
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:121)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
s3://com.castortech.repository/zk-8.5.0.tempfix/
at
org.eclipse.tycho.p2.resolver.P2DependencyResolver.addEntireP2RepositoryToTargetPlatform(P2DependencyResolver.java:308)
at
org.eclipse.tycho.p2.resolver.P2DependencyResolver.computePreliminaryTargetPlatform(P2DependencyResolver.java:212)
at
org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject(DefaultTychoResolver.java:109)
at
org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:95)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:266)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
... 11 more
Caused by: java.net.MalformedURLException: unknown protocol: s3
at java.net.URL.<init>(URL.java:600)
at java.net.URL.<init>(URL.java:490)
at java.net.URL.<init>(URL.java:439)
at
org.eclipse.tycho.p2.resolver.P2DependencyResolver.addEntireP2RepositoryToTargetPlatform(P2DependencyResolver.java:302)
... 17 more
I tried registering Wagon
<build>
<extensions>
<extension>
<groupId>org.kuali.maven.wagons</groupId>
<artifactId>maven-s3-wagon</artifactId>
<version>[S3 Wagon Version]</version>
</extension>
</extensions>
</build>
As per: https://github.com/jcaddel/maven-s3-wagon/wiki/Usage
https://github.com/eclipse/tycho/blob/master/tycho-p2/tycho-p2-facade/src/main/java/org/eclipse/tycho/p2/resolver/P2DependencyResolver.java
The error pops up when we try to generate a URL to then transform it into
a URI. Do you know if there's anything I'm missing or is what I'm doing
simply unsupported?
Regards,
Stephane
_______________________________________________
tycho-user mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user
--
Johan Compagner
Servoy
Loading...