نطاقات الاعتماديات (Dependency scopes)
في هذا الدرس 4 موضوعات
محتوى هذا الدرس مكتوب وينتظر المراجعة. يعرض المخطط أدناه ما سيغطيه، وسيُنشر بعد اعتماده.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
choose the right scope for each dependency.
الموضوعات المخطط لها
- A scope says when a dependency is needed: compile, test, or run.
compile(default): needed to build and run. Example: a library you call in your code.provided: needed to build, but the server supplies it at run time.runtime: not needed to compile, only to run. Example: a database driver.test: only for tests. Example: JUnit. Never usecompilefor test libraries.
تفاصيل المخطط المبدئي
عرض عملي
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>اختبر فهمك
Which scope for a JDBC driver you never call directly?
أظهر الإجابة
runtime.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.