2016-10-24 3 views
0

Für mehrere Stunden versuche ich eine .jar-Datei mit Maven-SSH bereitzustellen. Ohne Erfolg. Hier sind meine Config-Dateien:Bereitstellen mit Maven-ssh

<plugin> 
    <groupId>org.codehaus.mojo</groupId> 
    <artifactId>wagon-maven-plugin</artifactId> 
    <version>1.0</version> 
    <executions> 
     <execution> 
      <id>upload-jar</id> 
      <phase>deploy</phase> 
      <goals> 
       <goal>upload</goal> 
      </goals> 
      <configuration> 
       <fromFile>target/${project.build.finalName}.jar</fromFile> 
       <url>scp://172.16.11.122/foobar</url> 
       <toDir>.</toDir> 
      </configuration> 
     </execution> 
    </executions> 
</plugin> 

<extensions> 
    <extension> 
     <groupId>org.apache.maven.wagon</groupId> 
     <artifactId>wagon-ssh</artifactId> 
     <version>2.10</version> 
    </extension> 
</extensions> 

<distributionManagement>   
    <repository> 
     <id>lei.intra</id> 
     <url>scp://172.16.11.122/foo</url> 
    </repository> 
</distributionManagement> 

und in settings.xml

<server> 
    <id>lei.intra</id> 
    <username>xxx</username> 
    <password>yyy</password> 
    <filePermissions>775</filePermissions> 
    <directoryPermissions>775</directoryPermissions> 
</server> 

Ich denke, dass ich eine alte bin Mischen und eine neue Art und Weise. Warum sollte ich die URL angeben müssen zweimal (in der Plugin-Config und in distribution? Auch ich will von Windows implementieren intern und nicht PuTTYs pscp mit jsch.

Die aktuelle Fehlermeldung

com.jcraft.jsch.JSchException: reject HostKey: 172.16.11.122 

ist Could jemand bitte direkt mich zu einem Arbeits- und jüngeres Beispiel?

ich habe auch versucht <privateKey> in settings.xml mit meinem Kitt .ppk Datei angeben. PPK wahrscheinlich der falsche Schlüssel-Format ist. Kann ich es konvertieren?

Ich schaltete das Debuggen auf sshd und dies ist die Ausgabe:

debug3: fd 5 is not O_NONBLOCK 
debug1: Server will not fork when running in debugging mode. 
debug3: send_rexec_state: entering fd = 8 config len 736 
debug3: ssh_msg_send: type 0 
debug3: send_rexec_state: done 
debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8 
debug1: inetd sockets after dupping: 3, 3 
Connection from 172.16.11.1 port 22952 on 172.16.11.122 port 22 
debug1: Client protocol version 2.0; client software version JSCH-0.1.50 
debug1: no match: JSCH-0.1.50 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.1 
debug2: fd 3 setting O_NONBLOCK 
debug2: Network child is on pid 16885 
debug3: preauth child monitor started 
debug3: privsep user:group 110:65534 [preauth] 
debug1: permanently_set_uid: 110/65534 [preauth] 
debug3: list_hostkey_types: ssh-dss key not permitted by HostkeyAlgorithms [preauth] 
debug1: list_hostkey_types: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519 [preauth] 
debug3: send packet: type 20 [preauth] 
debug1: SSH2_MSG_KEXINIT sent [preauth] 
debug3: receive packet: type 20 [preauth] 
debug1: SSH2_MSG_KEXINIT received [preauth] 
debug2: local server KEXINIT proposal [preauth] 
debug2: KEX algorithms: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1 [preauth] 
debug2: host key algorithms: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519 [preauth] 
debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected] [preauth] 
debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected] [preauth] 
debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth] 
debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1 [preauth] 
debug2: compression ctos: none,[email protected] [preauth] 
debug2: compression stoc: none,[email protected] [preauth] 
debug2: languages ctos: [preauth] 
debug2: languages stoc: [preauth] 
debug2: first_kex_follows 0 [preauth] 
debug2: reserved 0 [preauth] 
debug2: peer client KEXINIT proposal [preauth] 
debug2: KEX algorithms: diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1 [preauth] 
debug2: host key algorithms: ssh-rsa,ssh-dss [preauth] 
debug2: ciphers ctos: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc [preauth] 
debug2: ciphers stoc: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc [preauth] 
debug2: MACs ctos: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96 [preauth] 
debug2: MACs stoc: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96 [preauth] 
debug2: compression ctos: none [preauth] 
debug2: compression stoc: none [preauth] 
debug2: languages ctos: [preauth] 
debug2: languages stoc: [preauth] 
debug2: first_kex_follows 0 [preauth] 
debug2: reserved 0 [preauth] 
debug1: kex: algorithm: diffie-hellman-group14-sha1 [preauth] 
debug1: kex: host key algorithm: ssh-rsa [preauth] 
debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha1 compression: none [preauth] 
debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha1 compression: none [preauth] 
debug2: bits set: 1036/2048 [preauth] 
debug1: expecting SSH2_MSG_KEXDH_INIT [preauth] 
debug3: receive packet: type 30 [preauth] 
debug2: bits set: 1020/2048 [preauth] 
debug3: mm_key_sign entering [preauth] 
debug3: mm_request_send entering: type 6 [preauth] 
debug3: mm_request_receive entering 
debug3: monitor_read: checking request 6 
debug3: mm_answer_sign 
debug3: mm_answer_sign: hostkey proof signature 0x56370529ae80(271) 
debug3: mm_request_send entering: type 7 
debug2: monitor_read: 6 used once, disabling now 
debug3: mm_key_sign: waiting for MONITOR_ANS_SIGN [preauth] 
debug3: mm_request_receive_expect entering: type 7 [preauth] 
debug3: mm_request_receive entering [preauth] 
debug3: send packet: type 31 [preauth] 
debug3: send packet: type 21 [preauth] 
debug2: set_newkeys: mode 1 [preauth] 
debug1: rekey after 4294967296 blocks [preauth] 
debug1: SSH2_MSG_NEWKEYS sent [preauth] 
debug1: expecting SSH2_MSG_NEWKEYS [preauth] 
debug3: receive packet: type 1 [preauth] 
Received disconnect from 172.16.11.1 port 22952:3: com.jcraft.jsch.JSchException: reject HostKey: lei.intra [preauth] 
Disconnected from 172.16.11.1 port 22952 [preauth] 
debug1: do_cleanup [preauth] 
debug3: PAM: sshpam_thread_cleanup entering [preauth] 
debug1: monitor_read_log: child log fd closed 
debug3: mm_request_receive entering 
debug1: do_cleanup 
debug3: PAM: sshpam_thread_cleanup entering 
debug1: Killing privsep child 16885 
debug1: audit_event: unhandled event 12 
+0

festgelegt. Sie haben diesen Link http://maven.apache.org/plugins/mavent-deploy-plugin/examples/deploy-ssh-external durchlaufen. HTML? Sie müssen "wagon-maven-plugin" nicht konfigurieren, sondern nur die Erweiterung "wagon-ssh-external" verwenden. – Tunaki

+0

Ja, ich kenne diese Seite. Dies ist ein Beispiel für waggon-ssh-external. Ich möchte es ohne externe Programme ausführen. wagon-ssh, nicht wagon-ssh-external – ropo

+0

Ich habe versucht, diesem Ansatz zu folgen: http://stackoverflow.com/questions/5819775/is-there-any-way-of-having-maven-scp-wagon-work- consequently-on-linux-mac-window aber ich bekomme da fehler: wenn ich das mit waggon-ssh 2.3-2.5 versuche, bekomme ich diese ausnahme: com.jcraft.jsch.JSchException: algorithm negotiation mit version 2.6-2.10 bekomme ich dies: com.jcraft.jsch.JSchException: HostKey ablehnen: Hostname – ropo

Antwort

0

Die Plugin wagon-Maven-Plugin nicht benötigt wird. Entfernt es.

Ich habe einige Fortschritte:

ssh-keyscan -t rsa server_ip_address_or_hostname 

und die Ausgabe in ~/.ssh/known_hosts

Den nächsten Fehler hinzufügen, ich erhielt, war „Zugriff verweigert“, wenn es versucht, Verzeichnisse von dem Start zu erstellen root-Verzeichnis. Als Workaround habe ich einen Ordner/Repository mit Schreibzugriff erstellt und <url>scp://172.16.11.122/repository</url>