コンソールからJSONでPOSTする方法
curl -H 'Content-Type:application/json' -X POST -d "{"key":"value", "key":"value"}" http://
エラー
{"code":400,"message":"Unable to process JSON"}
解決方法
curl -H 'Content-Type:application/json' -X POST -d '{"key":"value", "key":"value"}' http://
オプション-d
を" "
から' '
に変更したらうまくいった。
ローカルリポジトリを最新版にして、プッシュするまでの流れ
まずはmasterブランチを最新の状態にする
masterに移動
git checkout master
upstream(fork元)から最新のものを取ってくる
git fetch upstream
fetchしたものをローカルのmasterに反映させる(ローカルのmasterを最新にする)
git rebase upstream/master
最新にしたmasterをプッシュしておく
git push origin master
作業ブランチのコミットを1つにまとめてから最新にする
作業ブランチへ移動
git checkout 作業してるブランチ名
作業中のものを避ける
git stash
masterと差分のコミットを一つにまとめる
git rebase -i master
すると、こんな感じのが出てくる
pick ai9j38h 新機能追加 pick onw832h 修正 pick ji8h84h エラー修正 # Rebase bdd3996..bd66e17 onto bdd3996 # # Commands: # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash = use commit, but meld into previous commit # f, fixup = like "squash", but discard this commit's log message # x, exec = run command (the rest of the line) using shell # # If you remove a line here THAT COMMIT WILL BE LOST. # However, if you remove everything, the rebase will be aborted. #
i
を押してINSERTモードにして二つ目以降のコミットのpick
をsquash
へ変更する
pick ai9j38h 新機能追加 squash onw832h 修正 squash ji8h84h エラー修正 # Rebase bdd3996..bd66e17 onto bdd3996 # # Commands: # p, pick = use commit # r, reword = use commit, but edit the commit message # e, edit = use commit, but stop for amending # s, squash = use commit, but meld into previous commit # f, fixup = like "squash", but discard this commit's log message # x, exec = run command (the rest of the line) using shell # # If you remove a line here THAT COMMIT WILL BE LOST. # However, if you remove everything, the rebase will be aborted. #
esc
を押して、:wq
で保存する
作業してるブランチを最新にする
git rebase master 作業してるブランチ名
コンフリクトしたら、奴らと戦う
最新にした作業ブランチをプッシュ
git push origin 作業してるブランチ名
Java Gradle マルチプロジェクト作成方法
プロジェクト構成
multi-sample +--- sample-common +--- sample-core (sample-commonに依存)
- multi-sampleの直下でGradleによるプロジェクト初期化
gradle init
- settings.gradleを編集
rootProject.name = 'multi-sample' include "sample-common", "sample-core"
- build.gradleを編集
subprojects { apply plugin: 'eclipse' apply plugin: 'java' apply plugin: 'idea' def defaultEncoding = 'UTF-8' tasks.withType(JavaCompile) { options.encoding = defaultEncoding } sourceCompatibility = 1.8 targetCompatibility = 1.8 project.ext { authorName = 'YOUR NAME' dropwizardVersion = 'バージョン' } repositories { mavenCentral() } dependencies { compile "io.dropwizard:dropwizard-core:${dropwizardVersion}" } version = '1.0' task wrapper(type: Wrapper) { gradleVersion = '2.14' } } project(':sample-common') { } project(':sample-core') { dependencies { compile project(':sample-common') } }
gradle eclipse
を叩く