You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by zeiss <ze...@tut.by> on 2017/02/27 12:02:03 UTC

Re: Maven deploy direct to Karaf instance?

Hi Jean-Baptiste,

Maybe you could clarify one thing for me. Maven Deploy Plugin works with
files through Wagon providers. During deployment it has to create
directories as per standard Maven repository layout -
groupId/artifactId/version. If deployment is performed to remote host via
SCP, mkdir command is issued for that.

Now the thing that I don't understand. Karaf shell exposed through SSH is
not a POSIX-like shell. It does not provide commands like mkdir. Due to this
I cannot get deployment using Maven Deploy Plugin working - it simply fails
on attempt to create a directory.

I am curious how that deployment example from the documentation could
possibly work.

Thanks. 



--
View this message in context: http://karaf.922171.n3.nabble.com/Maven-deploy-direct-to-Karaf-instance-tp4042149p4049676.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Maven deploy direct to Karaf instance?

Posted by zeiss <ze...@tut.by>.
It does not matter which directory once creation of additional directories is
required, does it? scp directly to system works just fine.


jbonofre wrote
> Weird, I already did it AFAIR (but maybe upload to deploy and not system).





--
View this message in context: http://karaf.922171.n3.nabble.com/Maven-deploy-direct-to-Karaf-instance-tp4042149p4049701.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Maven deploy direct to Karaf instance?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Weird, I already did it AFAIR (but maybe upload to deploy and not system).

Let me improve that.

Regards
JB

On 02/28/2017 11:16 PM, zeiss wrote:
> In addition to the above: no, Karaf scp cannot create folder. Because scp by
> design does not handle creation of directories. Karaf, surely, could have a
> special scp implementation, but it does not. A simple test like 'scp -P 8101
> ~/test.txt karaf_host:/system/test/test.txt' demonstrates this. It fails
> with 'Can not write to system/test/test.txt'. This is another confirmation
> that maven-deploy-plugin cannot deploy to Karaf, even if it worked solely
> via scp.
>
> I am wondering what is the purpose of having invalid and obviously not
> working example in the Karaf documentation.
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Maven-deploy-direct-to-Karaf-instance-tp4042149p4049696.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofr
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Maven deploy direct to Karaf instance?

Posted by zeiss <ze...@tut.by>.
In addition to the above: no, Karaf scp cannot create folder. Because scp by
design does not handle creation of directories. Karaf, surely, could have a
special scp implementation, but it does not. A simple test like 'scp -P 8101
~/test.txt karaf_host:/system/test/test.txt' demonstrates this. It fails
with 'Can not write to system/test/test.txt'. This is another confirmation
that maven-deploy-plugin cannot deploy to Karaf, even if it worked solely
via scp.

I am wondering what is the purpose of having invalid and obviously not
working example in the Karaf documentation.




--
View this message in context: http://karaf.922171.n3.nabble.com/Maven-deploy-direct-to-Karaf-instance-tp4042149p4049696.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Maven deploy direct to Karaf instance?

Posted by zeiss <ze...@tut.by>.
While the protocol specified is 'scp', I can see that shell command
interpreter is expected by maven-deploy-plugin (by Wagon, to be more exact).
As I already mentioned, it tries to create directories on remote host by
using org.apache.maven.wagon.providers.ssh.ScpHelper. And 'mkdir' is used
for that as you can see from the implementation of 
createRemoteDirectories() method
<https://maven.apache.org/wagon/wagon-providers/wagon-ssh-common/apidocs/src-html/org/apache/maven/wagon/providers/ssh/ScpHelper.html#line.341>  
(some code omitted):

String mkdirCmd = "mkdir -p \"" + path + "\"";
executor.executeCommand( mkdirCmd );

At least this method is invoked on my system when I do 'mvn
deploy:deploy-file'.


jbonofre wrote
> If you do, mvn deploy:deploy-file with scp, Karaf scp can create folder 
> in the system folder (it's not ssh, it's scp).
> 
> So, it should work with scp, not with sshexe.





--
View this message in context: http://karaf.922171.n3.nabble.com/Maven-deploy-direct-to-Karaf-instance-tp4042149p4049678.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Maven deploy direct to Karaf instance?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi,

If you do, mvn deploy:deploy-file with scp, Karaf scp can create folder 
in the system folder (it's not ssh, it's scp).

So, it should work with scp, not with sshexe.

Regards
JB

On 02/27/2017 01:02 PM, zeiss wrote:
> Hi Jean-Baptiste,
>
> Maybe you could clarify one thing for me. Maven Deploy Plugin works with
> files through Wagon providers. During deployment it has to create
> directories as per standard Maven repository layout -
> groupId/artifactId/version. If deployment is performed to remote host via
> SCP, mkdir command is issued for that.
>
> Now the thing that I don't understand. Karaf shell exposed through SSH is
> not a POSIX-like shell. It does not provide commands like mkdir. Due to this
> I cannot get deployment using Maven Deploy Plugin working - it simply fails
> on attempt to create a directory.
>
> I am curious how that deployment example from the documentation could
> possibly work.
>
> Thanks.
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Maven-deploy-direct-to-Karaf-instance-tp4042149p4049676.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofr
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com