با آموزش نحوه نصب Apache Maven در سیستم عامل CentOS 8 در وبلاگ هاستینو درخدمت شما هستیم
Apache Maven چیست؟
Apache Maven ابزاری برای مدیریت و فهم پروژه اپن سورس است که در اصل برای پروژه های جاوا استفاده می شود. Maven از یک مدل Project Object Model (POM) استفاده می کند ، که در اصل یک فایل XML است.
که شامل اطلاعاتی در مورد پروژه ، جزئیات کانفیگ ، وابستگی های پروژه و غیره است.
مخازن استاندارد CentOS شامل بسته های Maven هستند که می توانند با مدیر بسته dnf نصب شوند. این ساده ترین روش برای نصب Maven در CentOS است. با این حال نسخه موجود در مخازن ممکن است از آخرین نسخه Maven عقب بماند. روش نصب متناسب با تنظیمات و محیط خود را انتخاب کنید.
پیش نیازها :
قبل از نصب به پیش نیاز هایی نیاز داریمک
مطمئن شوید که به عنوان root یا کاربر دارای امتیازات sudo وارد شده اید.
نصب Apache Maven در CentOS با Dnf / Yum :
نصب Maven در CentOS 8 با استفاده از dnf یک فرایند ساده و سر راست است.
با وارد کردن دستور زیر در ترمینال خود ، Maven را نصب کنید:
sudo dnf install maven
برای تأیید نصب ، دستور mvn -version را اجرا کنید:
mvn -version
خروجی باید چیزی شبیه به موارد زیر باشد:
Apache Maven 3.5.4 (Red Hat 3.5.4-5) Maven home: /usr/share/maven Java version: 1.8.0_232, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.232.b09-0.el8_0.x86_64/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "4.18.0-80.7.1.el8_0.x86_64", arch: "amd64", family: "unix"
Maven روی سیستم CentOS شما نصب شده است و می توانید از آن استفاده کنید.
نصب آخرین نسخه Apache Maven :
در این بخش ، ما گام به گام دستورالعمل نحوه نصب جدیدترین نسخه Apache Maven در CentOS 8 را ارائه خواهیم داد.
۱_ نصب OpenJDK :
Maven 3.3+ برای نصب به JDK 1.7 یا بالاتر نیاز دارد. OpenJDK 11 را با تایپ کردن دستور زیر نصب کنید:
sudo dnf install java-11-openjdk-devel
با اجرای دستور زیر تأیید کنید که جاوا با موفقیت نصب شده است:
java -version
خروجی باید چیزی شبیه به موارد زیر باشد:
openjdk version "11.0.5" 2019-10-15 LTS OpenJDK Runtime Environment 18.9 (build 11.0.5+10-LTS) OpenJDK 64-Bit Server VM 18.9 (build 11.0.5+10-LTS, mixed mode, sharing)
۲_ دانلود Apache Maven :
در زمان نوشتن این مقاله ، آخرین نسخه Apache Maven 3.6.3 است. صفحه دانلود Maven را بررسی کنید شاید نسخه جدیدتری در دسترس باشد. دانلود برنامه Apache Maven در دایرکتوری / tmp را با دستور wget شروع کنید:
wget https://www-us.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz -P /tmp
پس از اتمام دانلود ، بایگانی را در دایرکتوری / opt اکسترکت کنید:
sudo tar xf /tmp/apache-maven-3.6.3-bin.tar.gz -C /opt
برای کنترل بیشتر بر نسخه ها و به روزرسانی های Maven ، ما یک پیوند نمادین maven ایجاد خواهیم کرد که به دایرکتوری نصب Maven اشاره خواهد کرد:
sudo ln -s /opt/apache-maven-3.6.3 /opt/maven
برای به روزرسانی نصب Maven خود ، نسخه جدیدتر را باز کنید و symlink را تغییر دهید.
۳_ تنظیم متغیرهای محیط :
در مرحله بعدی ، باید متغیرهای محیط را تنظیم کنیم. ویرایشگر متن خود را باز کنید و یک فایل جدید با نام maven.sh در دایرکتوری /etc/profile.d/ ایجاد کنید:
sudo nano /etc/profile.d/maven.sh
کد زیر را جایگذاری کنید:
export JAVA_HOME=/usr/lib/jvm/jre-openjdk export M2_HOME=/opt/maven export MAVEN_HOME=/opt/maven export PATH=${M2_HOME}/bin:${PATH}
ذخیره کنید و فایل را ببندید. با اجرای دستور chmod زیر ، اسکریپت را قابل اجرا کنید:
sudo chmod +x /etc/profile.d/maven.sh
متغیرهای محیط را با استفاده از دستور source دانلود کنید:
source /etc/profile.d/maven.sh
۴_ تایید نصب :
برای تأیید نصب Maven ، از دستور mvn -version که نسخه Maven را نشان می دهد ، استفاده کنید :
mvn -version
شما باید چیزی مانند موارد زیر را ببینید:
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home: /opt/maven Java version: 11.0.5, vendor: Oracle Corporation, runtime: /usr/lib/jvm/java-11-openjdk-11.0.5.10-0.el8_0.x86_64 Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "4.18.0-80.7.1.el8_0.x86_64", arch: "amd64", family: "unix"نتیجه :
در این مقاله در هاستینو به شما آمورش دادیم Apache Maven را در CentOS 8 نصب کنید. اکنون باید به صفحه رسمی Apache Maven Documentation مراجعه کرده و نحوه شروع کار با Maven را بیاموزید.
**mindvault**
mindvault is a premium cognitive support formula created for adults 45+. It’s thoughtfully designed to help maintain clear thinking
**prostadine**
prostadine is a next-generation prostate support formula designed to help maintain, restore, and enhance optimal male prostate performance.
**sugarmute**
sugarmute is a science-guided nutritional supplement created to help maintain balanced blood sugar while supporting steady energy and mental clarity.
**glpro**
glpro is a natural dietary supplement designed to promote balanced blood sugar levels and curb sugar cravings.
**mitolyn**
mitolyn a nature-inspired supplement crafted to elevate metabolic activity and support sustainable weight management.
**zencortex**
zencortex contains only the natural ingredients that are effective in supporting incredible hearing naturally.
**prodentim**
prodentim an advanced probiotic formulation designed to support exceptional oral hygiene while fortifying teeth and gums.
**vittaburn**
vittaburn is a liquid dietary supplement formulated to support healthy weight reduction by increasing metabolic rate, reducing hunger, and promoting fat loss.
**yu sleep**
yusleep is a gentle, nano-enhanced nightly blend designed to help you drift off quickly, stay asleep longer, and wake feeling clear.
**synaptigen**
synaptigen is a next-generation brain support supplement that blends natural nootropics, adaptogens
**nitric boost**
nitric boost is a dietary formula crafted to enhance vitality and promote overall well-being.
**glucore**
glucore is a nutritional supplement that is given to patients daily to assist in maintaining healthy blood sugar and metabolic rates.
**wildgut**
wildgutis a precision-crafted nutritional blend designed to nurture your dog’s digestive tract.
**pinealxt**
pinealxt is a revolutionary supplement that promotes proper pineal gland function and energy levels to support healthy body function.
**energeia**
energeia is the first and only recipe that targets the root cause of stubborn belly fat and Deadly visceral fat.
**boostaro**
boostaro is a specially crafted dietary supplement for men who want to elevate their overall health and vitality.
**prostabliss**
prostabliss is a carefully developed dietary formula aimed at nurturing prostate vitality and improving urinary comfort.
**breathe**
breathe is a plant-powered tincture crafted to promote lung performance and enhance your breathing quality.
**potentstream**
potentstream is engineered to promote prostate well-being by counteracting the residue that can build up from hard-water minerals within the urinary tract.
**hepato burn**
hepato burn is a premium nutritional formula designed to enhance liver function, boost metabolism, and support natural fat breakdown.
**hepato burn**
hepato burn is a potent, plant-based formula created to promote optimal liver performance and naturally stimulate fat-burning mechanisms.
**cellufend**
cellufend is a natural supplement developed to support balanced blood sugar levels through a blend of botanical extracts and essential nutrients.
**prodentim**
prodentim is a forward-thinking oral wellness blend crafted to nurture and maintain a balanced mouth microbiome.
**flowforce max**
flowforce max delivers a forward-thinking, plant-focused way to support prostate health—while also helping maintain everyday energy, libido, and overall vitality.
**revitag**
revitag is a daily skin-support formula created to promote a healthy complexion and visibly diminish the appearance of skin tags.
**neurogenica**
neurogenica is a dietary supplement formulated to support nerve health and ease discomfort associated with neuropathy.
**sleeplean**
sleeplean is a US-trusted, naturally focused nighttime support formula that helps your body burn fat while you rest.
**memory lift**
memory lift is an innovative dietary formula designed to naturally nurture brain wellness and sharpen cognitive performance.
https://t.me/Top_BestCasino/166