问题
I am trying to use ssh publisher to publish artifacts to a remote server through jenkins.
<ssh name="ssh-publisher" host="myhost.com" user="dummy" keyFile="/home/dummy/id_rsa">
<ivy pattern="/data/refdata/local0/artifacts[organisation]/[module]/[revision]/ivy-[revision].xml"/>
<artifact pattern="/data/refdata/local0/artifacts/[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]"/>
</ssh>
However when I tried to publish, I got the following error
impossible to publish artifacts for <my.artifacts>;<my.version>: java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
at java.awt.Window.<init>(Window.java:407)
at java.awt.Frame.<init>(Frame.java:402)
at java.awt.Frame.<init>(Frame.java:367)
at javax.swing.SwingUtilities$SharedOwnerFrame.<init>(SwingUtilities.java:1731)
....
So I set the DISPLAY variable in the bash_profile of the remote user, I tried both
export DISPLAY=:0.0
export DISPLAY=<jenkin.server.ip>:0.0
But none of them works. Could someone shed lights on me how to work this out? Thanks!
回答1:
I think Ivy is trying to prompt you to enter a password but since Jenkins is running headless, it cannot do so. Check your keyfile.
来源:https://stackoverflow.com/questions/12486604/ivy-ssh-publisher