http://computercamp.cdwilson.us/jenkins-git-clone-via-ssh-on-windows-7-x64
Download and install Git for Windows from http://code.google.com/p/msysgit/downloads/list?can=3
Download and install Jenkins for Windows from http://mirrors.jenkins-ci.org/windows/latest
Install the Git plugin:
-
Go to “Manage Jenkins” –> “Manage Plugins” –> “Available”
-
Check the box next to “Git Plugin”
-
Click “Download now and install after restart”
-
After the message “Downloaded Successfully…” check the box “Restart Jenkins…”
-
Click the link “ENABLE AUTO REFRESH” in the top right of the page
Now we need to configure Jenkins to know where the git cmd is located.
Go to “Manage Jenkins” –> “Configure System”
Under “git” change “Path to Git executable” to C:\Git\cmd\git.cmd (NOT C:\Git\bin\git.exe)
Click the “Save” button
By default, the Jenkins installer sets up Jenkins to run as a service, which runs as the “Local System account”, NOT your user account. Since the “Local System account” does not have SSH keys or known_hosts set up, “git clone” will fail.
We need to add your Jenkins build SSH keys (id_rsa and id_rsa.pub) to the “Local System account” and we need to populate the known_hosts file with the remote server info.
First, copy your Jenkins build SSH keys into C:\Git\.ssh so that ssh.exe can find them.
Open a normal cmd.exe shell and type the following:
c:\>"C:\Git\bin\ssh.exe" -T git@your.git.server
You should get a response that looks like:
The authenticity of host 'your.git.server (xxx.xxx.xxx.xxx)' can't be established. RSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx. Are you sure you want to continue connecting (yes/no)?
Type yes and you should see something like:
Warning: Permanently added 'git.sfo.archrock.com,172.27.164.249' (RSA) to the list of known hosts. ...
This has added the remote server to C:\Git\.ssh\known_hosts
Next, copy C:\Git\.ssh to C:\Windows\SysWOW64\config\systemprofile\.ssh (the “Local System account” home).
Now set up a new Jenkins job and you should be able to clone via SSH!
If you want to actually test running git commands AS the “Local System account”, you need to run cmd.exe as the “Local System account”, which requires PsTools.
Download and extract PsTools from http://download.sysinternals.com/Files/PsTools.zip
Open a normal cmd shell and run:
c:\>PsTools/PsExec.exe -i -s cmd.exe
This should open a new cmd prompt running as the “Local System account” and any SSH commands you run in this account will use the keys in C:\Windows\SysWOW64\config\systemprofile\.ssh
You can now test Git commands running as the same user as Jenkins.
weight是比重,在线性布局中用来分配各组件的空间.
由于方向要么是竖直要么是水平,以竖直为例来分开说明三个属性的互相影响.
假设有一个竖直排列的线性布局,其中有两个组件,A和B
1.若要A和B严格按照weight比例分配空间,则必须设置两个的height都为0或者都为fillparent.
2.若其中有一个为wrapcontent,且weight设为0,则不管其他组件weight怎样,至少要将该组件显示完全.
3.wrapcontent时,weight数值越大,空间越大.
fillparent时,weight数值越大,空间越小.
暂时发现就这些....
我觉得其中wrapcontent情况下使用weight比较有用.不管父组件如何,总能给组件留下一个位置.
省去了使用相对布局来布置界面,毕竟相对布局没有线性布局兼容性高.
在开发新浪微博的时候我使用了android中的ListView中的FootView来增加一个更多项来动态添加数据。但是我在开发的时候却遇到这个问题就是我添加了这个FootView的时候我通过在后台去下载数据比如:图片和一下文字信息的时候当后台有了数据过个通过消息机制来通知主线程去刷新UI(这里需要注意的是我们在开发当中所有的UI刷新必须在主线程去刷新界面,因为android中UI线程是不安全的其他我也不多说了网上有许多的资料啦...)回到问题当接收到了后台的消息过后我们要去刷新界面(主线程中)这是我们会调用
:((homeActivityBaseAdapter)listView.getAdapter
()).notifyDataSetChanged();这个方法去刷新界面。简单的介绍一下homeActivityBaseAdapter这个是我自定义的继承于BaseAdapter的适配器,这是系统会跑出异常:java.lang.ClassCastException:android.widget.HeaderViewListAdapter这时我们可以看到这个.HeaderViewListAdapter这个关键词,通过这个可以知道
:android.widget.HeaderViewListAdapter 不能强转为listview的异常信息,这是因为当向listview中加入headerview或者footviwer时,调用ListView的setAdapter方法会将adapter转化为headerviewlistadapter
解决方法:
HeaderViewListAdapter listAdapter = (HeaderViewListAdapter) listView.getAdapter();
homeActivityBaseAdapter adapter = (homeActivityBaseAdapter)listAdapter.getWrappedAdapter();
adapter.notifyDataSetChanged();
。。。。希望对你有帮助哈!!!
先表示感谢了