انتقل إلى المحتوى
أمين أبوزيد
BEG-054

أدوات البناء

  • 6 درس
  • 61 دقيقة قراءة
  • 2.5 ساعة تدريب (تقدير)
في هذه الصفحة 8 موضوعات

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

نظرة عامة

الموضوعات

  • أساسيات Maven
  • pom.xml
  • الاعتماديات (dependencies)
  • دورة حياة البناء
  • تشغيل الاختبارات

تعلّم أولًا

61 دقيقة قراءة · 2.5 ساعة تدريب (تقدير)

مخرجات التعلم

  1. Explain what a build tool does and why manual javac does not scale.
  2. Read a pom.xml: coordinates, dependencies, and plugins.
  3. Run mvn compile, test, and package and explain the lifecycle phases.
  4. Add a dependency from Maven Central and convert an existing project to Maven.

الدروس

  1. 01لماذا أدوات البناء11 د قراءة
  2. 02بنية المشروع وpom.xml10 د قراءة
  3. 03الاعتماديات وMaven Central10 د قراءة
  4. 04دورة حياة البناء10 د قراءة
  5. 05تشغيل الاختبارات باستخدام Maven10 د قراءة
  6. 06عرض عملي: تحويل مشروع إلى Maven10 د قراءة

المختبر والتمارين

Lab

BEG-054-LAB1 · Mavenize

Outcomes: 1–4 · Time: ~2.5 h Convert the data-structures project to Maven with JUnit as a test dependency; mvn test passes from the terminal. Acceptance: builds on a clean machine.

Exercises (assessment: practical check)

IDOutcomeTask
BEG-054-EX011List three problems with compiling a ten-library project by hand with javac.
BEG-054-EX022Label groupId, artifactId, version, a dependency, and a plugin in a given pom.xml.
BEG-054-EX032Place five given files into the correct Maven folders.
BEG-054-EX043Run mvn compile, mvn test, and mvn package; say what each produced.
BEG-054-EX053Explain why mvn package also runs the tests.
BEG-054-EX064Add a library from Maven Central and use one class from it.
BEG-054-EX074Make sure target/ is not committed in the converted project.
أظهر الحلول
  • EX01 Long class paths, manual downloads of JARs, no repeatable steps (and no test running).
  • EX02 Coordinates sit at the top; dependencies under <dependencies>; plugins under <build><plugins>.
  • EX03 Main classes in src/main/java; tests in src/test/java; pom.xml at the root.
  • EX04 compile makes classes in target/classes; test runs tests; package creates a JAR in target/.
  • EX05 Lifecycle phases run in order; test comes before package.
  • EX06 Add the <dependency> block, then import its class; Maven downloads it on the next build.
  • EX07 .gitignore contains target/; git status does not show it.

الاختبار

Outcomes: O1 why build tools · O2 pom.xml · O3 lifecycle · O4 dependencies and conversion.

اختبار ذاتي لك: لا توجد درجات، ولا يُحفظ أو يُرسل أي شيء. اختر إجابة ثم تحقق منها، ويمكنك المحاولة مرة أخرى كما تشاء.

  1. 1A build tool mainly:O1
  2. 2Manual javac does not scale because:O1
  3. 3Main Java source folder in Maven:O2
  4. 4Test code lives in:O2
  5. 5Which identifies a Maven project?O2
  6. 6mvn test also runs:O3
  7. 7mvn clean does what?O3
  8. 8Dependencies are downloaded from:O4
  9. 9JUnit should have scope:O4
  10. 10Should target/ be committed?O4

الجزء العملي

Practical check: the data-structures project builds and mvn test passes from a clean clone (lab and EX01–EX07). Pass: at least 8 of 10 quiz questions and a build that works on a clean machine.

أخطاء شائعة

Wrong folder layout; committing target/.

التقييم

Practical check.

الصلة بالمسار الوظيفي

Maven in depth (JNR-002).

اكتب للبحث في المستويات والمراحل والوحدات والدروس.