Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support auto-configuration class for spring boot #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kazuki43zoo
Copy link
Contributor

I will suggest to add the auto configuration class for spring boot !

そして以降は、日本語で。

ども〜。久々にMixer 2にcontributeしてみよう。(JJUGのスライド見てふとw)
(2つBean定義すればよいだけなので、作る必要はない気はしたけど)Spring BootのAuto Configurationクラスつくってみました。 Mixer 2も推奨構成で作れば設定レスだよ〜的な。

デフォルト値はリファレンスの設定値を参考にしましたが、templateファイルを格納するパスどうしようかな〜と少し悩みました。Spring Boot的にはclasspath:/templates/だしな〜と。
あ〜あと、非Boot環境で誤作動しないかちょっと不安・・・。

ほんとは別プロジェクトの方がいいのかもしれないですが、いったん本家に混ぜ込んでPRしてみました。

ちなみに・・・Mixer 2ってResourceUrlEncodingFilterとの連携(静的リソースへのURLとかにバージョンをつけられるやつ)ってサポートしてます?。もしサポートしてるなら、ResourceUrlEncodingFilterのBean定義も自動で定義してあげるとよさそう。

そのまま取り込んでもらうつもりでPRしてないんで、Auto Configurationサポートするなら参考にして頂ければ幸いです!!

ではでは。

@kazuki43zoo
Copy link
Contributor Author

kazuki43zoo commented Dec 4, 2016

非Boot環境で誤作動しないかちょっと不安

これ大丈夫そうでした。https://github.com/nabedge/mixer2-sample のアプリにlocalにインストールした1.3-SNAPSHOTを使ってもそれっぽく動いているので。

あと https://github.com/nabedge/mixer2-spboot14-sample を1.3-SNAPSHOTに変更してBean定義削除+
ymlでprefixとview-base-packageを調整して動きました。Mixer使うときの推奨設定がきまっていれば、それにあわせてデフォルト値もうければ、設定レスでMixer 2使えるようになると思います。

@kazuki43zoo kazuki43zoo force-pushed the support-spring-boot-autoconfigure branch from 8af324f to 63615ce Compare December 4, 2016 03:24
@nabedge
Copy link
Owner

nabedge commented Mar 29, 2017

やばい、これ忘れてた。ごめんなさいごめんなさい.
GWにやります

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants