Apache Ivy ডিপেনডেন্সি ম্যানেজমেন্ট টুল হিসেবে ব্যবহৃত হয় এবং এটি আপনাকে আপনার প্রোজেক্টের জন্য প্রয়োজনীয় লাইব্রেরি এবং ডিপেনডেন্সি গুলি রেজলভ করতে সহায়তা করে। Ivy-তে Exclude এবং Include কনফিগারেশন ব্যবহার করে আপনি নির্দিষ্ট ডিপেনডেন্সি বা তাদের নির্দিষ্ট ভার্সনগুলিকে অন্তর্ভুক্ত বা বহিষ্কার করতে পারেন।
এটি বিশেষভাবে দরকারি যখন আপনি একটি লাইব্রেরির উপর নির্ভরশীল থাকেন, কিন্তু কিছু নির্দিষ্ট ট্রান্সিটিভ ডিপেনডেন্সি (যেগুলি সেই লাইব্রেরি দ্বারা যুক্ত করা হয়েছে) আপনার প্রোজেক্টের জন্য উপযুক্ত নয়।
Ivy-তে একটি নির্দিষ্ট ডিপেনডেন্সি বা ট্রান্সিটিভ ডিপেনডেন্সি exclude করতে, আপনি <exclude>
ট্যাগ ব্যবহার করতে পারেন। এটি নির্দিষ্ট লাইব্রেরি থেকে অপ্রয়োজনীয় ডিপেনডেন্সি সরিয়ে ফেলতে সহায়তা করে।
<ivy-module version="2.0">
<info organisation="com.example" module="myproject" revision="1.0"/>
<dependencies>
<!-- Include spring-core dependency, but exclude commons-logging -->
<dependency org="org.springframework" name="spring-core" rev="5.3.10">
<exclude org="commons-logging" module="commons-logging"/>
</dependency>
<!-- Another example: Exclude log4j from commons-logging -->
<dependency org="org.apache.commons" name="commons-logging" rev="1.2">
<exclude org="log4j" module="log4j"/>
</dependency>
</dependencies>
</ivy-module>
এখানে:
<exclude org="commons-logging" module="commons-logging"/>
ট্যাগটি spring-core
লাইব্রেরি থেকে commons-logging
লাইব্রেরিটি বাইরে রেখে দেয়।<exclude org="log4j" module="log4j"/>
ট্যাগটি commons-logging
থেকে log4j
লাইব্রেরি বহিষ্কার করবে।log4j
) ব্যবহার করে, কিন্তু আপনার প্রকল্পে এটি ব্যবহার করার প্রয়োজন না থাকে, তবে আপনি এটি exclude করতে পারেন।<include>
ট্যাগ ব্যবহার করে Ivy-তে আপনি কেবলমাত্র নির্দিষ্ট ডিপেনডেন্সি বা ট্রান্সিটিভ ডিপেনডেন্সি অন্তর্ভুক্ত করতে পারেন। এটি আপনাকে নির্দিষ্ট ডিপেনডেন্সি রেজলভ করতে এবং আপনার প্রকল্পে শুধুমাত্র সেই ডিপেনডেন্সি অন্তর্ভুক্ত করতে সহায়তা করে।
<ivy-module version="2.0">
<info organisation="com.example" module="myproject" revision="1.0"/>
<dependencies>
<!-- Include spring-core dependency and all transitive dependencies -->
<dependency org="org.springframework" name="spring-core" rev="5.3.10">
<include org="org.springframework" module="spring-beans"/>
</dependency>
<!-- Another example: Include commons-logging and log4j only -->
<dependency org="org.apache.commons" name="commons-logging" rev="1.2">
<include org="log4j" module="log4j"/>
</dependency>
</dependencies>
</ivy-module>
এখানে:
<include org="org.springframework" module="spring-beans"/>
: এটি spring-core
থেকে spring-beans
ট্রান্সিটিভ ডিপেনডেন্সি অন্তর্ভুক্ত করবে।<include org="log4j" module="log4j"/>
: এটি commons-logging
থেকে log4j
অন্তর্ভুক্ত করবে।<include>
ট্যাগ ব্যবহার করবেন।Exclude
এবং Include
এর পার্থক্যExclude
:exclude
ব্যবহার করবেন।Include
:include
দিয়ে আপনি নির্দিষ্ট ট্রান্সিটিভ ডিপেনডেন্সি রেজলভ করতে পারেন এবং আপনার প্রোজেক্টে তা অন্তর্ভুক্ত করতে পারেন।Ivy আপনাকে include
এবং exclude
একসাথে ব্যবহার করার অনুমতি দেয়। উদাহরণস্বরূপ, আপনি একটি লাইব্রেরি থেকে কিছু ট্রান্সিটিভ ডিপেনডেন্সি অন্তর্ভুক্ত করতে পারেন এবং কিছু অপ্রয়োজনীয় ডিপেনডেন্সি বাদ দিতে পারেন।
<ivy-module version="2.0">
<info organisation="com.example" module="myproject" revision="1.0"/>
<dependencies>
<!-- Include spring-core and exclude commons-logging -->
<dependency org="org.springframework" name="spring-core" rev="5.3.10">
<include org="org.springframework" module="spring-beans"/>
<exclude org="commons-logging" module="commons-logging"/>
</dependency>
</dependencies>
</ivy-module>
এখানে:
<include>
ট্যাগ ব্যবহার করে spring-beans
ইনক্লুড করা হয়েছে।<exclude>
ট্যাগ ব্যবহার করে commons-logging
এক্সক্লুড করা হয়েছে।Apache Ivy আপনাকে exclude এবং include ট্যাগ ব্যবহার করে ডিপেনডেন্সি ম্যানেজমেন্টে অনেক ফ্লেক্সিবিলিটি দেয়। আপনি যখন কোনো লাইব্রেরি বা ট্রান্সিটিভ ডিপেনডেন্সি আপনার প্রোজেক্টে অপ্রয়োজনীয় মনে করেন, তখন exclude
ব্যবহার করতে পারেন, আর যখন আপনি কোনো নির্দিষ্ট ডিপেনডেন্সি রেজলভ করতে চান যা সাধারণত ডিফল্টরূপে অন্তর্ভুক্ত হয় না, তখন include
ব্যবহার করতে পারেন। এটি ডিপেনডেন্সি ম্যানেজমেন্টকে আরও কাস্টমাইজেবল এবং কার্যকরী করে তোলে।
common.read_more