[
https://issues.jboss.org/browse/DROOLS-194?page=com.atlassian.jira.plugin...
]
Kurt Stam edited comment on DROOLS-194 at 10/1/13 4:31 PM:
-----------------------------------------------------------
Hi Mario,
1. We store the kieJars in our S-RAMP repository (instead of maven).
2. Now when KIE wants to read this kiejar
(
https://github.com/Governance/dtgov/blob/master/dtgov-war/src/main/java/o...)
we register the sramp Wagon extension:
{code:java}
Extension extension = new Extension();
extension.setArtifactId("s-ramp-wagon"); //$NON-NLS-1$
extension.setGroupId("org.overlord.sramp"); //$NON-NLS-1$
extension.setVersion(wagonVersion);
build.addExtension(extension);
project.setBuild(build);
{code:}
So this registers the sramp protocol.
The issue is that in your Aether class you don't honor this custom protocol. So to fix
this we added
{code:java}
@Override
public Wagon lookup( String roleHint ) throws Exception {
if ( "http".equals( roleHint ) ) { //$NON-NLS-1$
return new AhcWagon();
}
if ( "sramp".equals( roleHint ) ) { //$NON-NLS-1$
return new SrampWagonProxy();
}
return null;
}
{code}
However it should be possible to have it figure this out byitself; or at least one should
be able to add Wagon by way of configuration.
I'm going to add a test for it using something like the FileWagon so you don't
need a running S-RAMP server.
was (Author: kurtstam):
Hi Mario,
1. We store the kieJars in our S-RAMP repository (instead of maven).
2. Now when KIE wants to read this kiejar
(
https://github.com/Governance/dtgov/blob/master/dtgov-war/src/main/java/o...)
we register the sramp Wagon extension:
<code>
Extension extension = new Extension();
extension.setArtifactId("s-ramp-wagon"); //$NON-NLS-1$
extension.setGroupId("org.overlord.sramp"); //$NON-NLS-1$
extension.setVersion(wagonVersion);
build.addExtension(extension);
project.setBuild(build);
</code>
So this registers the sramp protocol.
The issue is that in your Aether class you don't honor this custom protocol. So to fix
this we added
<code>
@Override
public Wagon lookup( String roleHint ) throws Exception {
if ( "http".equals( roleHint ) ) { //$NON-NLS-1$
return new AhcWagon();
}
if ( "sramp".equals( roleHint ) ) { //$NON-NLS-1$
return new SrampWagonProxy();
}
return null;
}
</code>
However it should be possible to have it figure this out byitself; or at least one should
be able to add Wagon by way of configuration.
I'm going to add a test for it using something like the FileWagon so you don't
need a running S-RAMP server.
Add support in KIE to register custom Wagons
--------------------------------------------
Key: DROOLS-194
URL:
https://issues.jboss.org/browse/DROOLS-194
Project: Drools
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Reporter: Kurt Stam
Assignee: Mark Proctor
The ManualWagonProvider subclass of Aether in KIE registers the HTTPWagon. It should be
possible to add your own Wagon through config our automated machinery when another Wagon
is put on the classpath and references in the build/extensions of a MavenProject. To get
the SrampWagon to work we used the following code:
{quote}
private static class ManualWagonProvider implements WagonProvider {
public Wagon lookup( String roleHint ) throws Exception {
if ( "http".equals( roleHint ) ) {
return new AhcWagon();
}
if ( "sramp".equals( roleHint ) ) {
return new SrampWagon();
}
return null;
}
public void release( Wagon wagon ) { }
}
{quote}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:
http://www.atlassian.com/software/jira