2017-12-12 4 views
1

モジュールに推移的な依存関係を持つライブラリを使用していますが、 "abc.xyz:abc-module:1.1.1"と仮定すると、問題はそのグループのすべてのモジュールがビルドで除外されます。何らかの理由でgradleを使用すると、推移的な依存関係が期待どおりに無視されます。以前のように残りの1つを除外しながらabc-moduleを含めるように指定できる方法はありますか?グループから特定のモジュールを取り込み、残りをgradleで除外する方法はありますか?

答えて

0

私はあなたが

configurations { 
    compile { 
     resolutionStrategy { 
      componentSelection { 
       all { ComponentSelection selection -> 
        if (selection.candidate.group == 'abc.xyz' && selection.candidate.module != 'abc-module') { 
         selection.reject('Dependencies from group "abc.xyz" except of "abc-module" are not allowed.') 
        } 
       } 
      } 
     } 
    } 
} 
のようなコンポーネントの選択ルールで、あなたがやりたいことができるはずだと思います
関連する問題