أدوات البناء
في هذه الصفحة 8 موضوعات
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
نظرة عامة
الموضوعات
- أساسيات Maven
- pom.xml
- الاعتماديات (dependencies)
- دورة حياة البناء
- تشغيل الاختبارات
تعلّم أولًا
61 دقيقة قراءة · 2.5 ساعة تدريب (تقدير)
مخرجات التعلم
- Explain what a build tool does and why manual
javacdoes not scale. - Read a
pom.xml: coordinates, dependencies, and plugins. - Run
mvn compile,test, andpackageand explain the lifecycle phases. - Add a dependency from Maven Central and convert an existing project to Maven.
الدروس
المختبر والتمارين
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)
| ID | Outcome | Task |
|---|---|---|
| BEG-054-EX01 | 1 | List three problems with compiling a ten-library project by hand with javac. |
| BEG-054-EX02 | 2 | Label groupId, artifactId, version, a dependency, and a plugin in a given pom.xml. |
| BEG-054-EX03 | 2 | Place five given files into the correct Maven folders. |
| BEG-054-EX04 | 3 | Run mvn compile, mvn test, and mvn package; say what each produced. |
| BEG-054-EX05 | 3 | Explain why mvn package also runs the tests. |
| BEG-054-EX06 | 4 | Add a library from Maven Central and use one class from it. |
| BEG-054-EX07 | 4 | Make 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 insrc/test/java;pom.xmlat the root. - EX04
compilemakes classes intarget/classes;testruns tests;packagecreates a JAR intarget/. - EX05 Lifecycle phases run in order;
testcomes beforepackage. - EX06 Add the
<dependency>block, then import its class; Maven downloads it on the next build. - EX07
.gitignorecontainstarget/;git statusdoes not show it.
الاختبار
Outcomes: O1 why build tools · O2 pom.xml · O3 lifecycle · O4 dependencies and conversion.
اختبار ذاتي لك: لا توجد درجات، ولا يُحفظ أو يُرسل أي شيء. اختر إجابة ثم تحقق منها، ويمكنك المحاولة مرة أخرى كما تشاء.
الجزء العملي
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).