Artikel ini terutama memperkenalkan konfigurasi konstruksi dan ide dari lingkungan Maven. Itu dibagikan dengan Anda. Dengan rincian sebagai berikut:
MAVEN Unduh: http://maven.apache.org/download.cgi
Alamat Gudang Maven Central: http://search.maven.org
Konfigurasikan variabel lingkungan maven
M2_home: d: /workspace/maven/apache-maven-3.0.5
Jalur :;%m2_home%/bin;
Periksa apakah itu berhasil dan buka CMD:
Mvn -v
Instal MVN akan menginstal komponen yang dihasilkan dari proyek ke repositori Maven lokal
MVN Deploy digunakan untuk mendistribusikan artefak yang dihasilkan dari proyek ke repositori Maven jarak jauh
D:/> MVN Archetype: Generate: Build Maven Standard Project Directory Struktur pada D: Disk
2. Konfigurasi File Settings.xml
2.0 Ubah Lokasi Repositori Lokal
conf/settings.xml di direktori m2_home
<cocalrepository> D:/workspace/maven/stone </cocalrepository>
2.1 Cara Mengkonfigurasi Repositori Remote (Private Server): (Nexus-2.0.4-1-Bundle)
<profiles> <profile> <dent> nexus </dent> <r repositories> <!-Mengkonfigurasi repositori jarak jauh-> <repository> <dent> nexus </dent> <name> Repositori pusat </name> <rrtp://127.0.0.1/nexus/content/groups/kroups/127.0.0.1/nexus/content/groups/groups/127.0.0.1/nexus/content/groups/groups/127.0.0.1/nexus/content/croups <Enabled> true </inableed> </seleases> <snapshots> <denabled> false </denabled> <! ----- </snapshots> </b repository> </repository> </ Repository> </ Repository> <luginRepository> <dd nexus> </id name> </ Repository> <PluginRepository> <dde> Nexus </dent> </idository> Centrosory </ID NEXUS </id </id </id name> </idository> centrosorory> <d pluginRepository> <d Repository> <ID> </ID </id </d Repository> <rerl> http://127.0.0.1/nexus/content/groups/public </rerl> <seleases> <denabled> true </denabled> </seleases> <plugin> <denably> </enabled> </snapshots> </pluginrotor> <denably> </enabled> </snapshots> </pluginrotor> <denably> </enabled> </snapshots> </pluginrotor> <ActiveProfiles> <!-Aktifkan repositori jarak jauh-> <ActiveProfile> nexus </activeProfile> </activeProfiles>
2.2 Anda juga dapat mengonfigurasi unduhan gambar repositori
<mirrors> <cermin> <!-Mirror Konfigurasi-> <den> nexus </drorof>*</mirrorof> <rerl> http://127.0.0.1/nexus/content/groups/public </rrrl> </cermin> </cermin> mirror>
3. Ketergantungan Konfigurasi File Pom.xml
<Project xmlns = "http://maven.apache.org/pom/4.0.0" xmlns: xsi = "http://www.w3.org/2001/xmlschema-instance" xsi: schemalocation = "http:/maven.romp.romp.romp. http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>xu.feifei</groupId> <artifactId>feifei</artifactId> <packaging>war</packaging> <version>1.0</version> <dependencies> <dependency> <groupid> junit </groupid> <ArTifactId> junit </artifactid> <version> 3.8.1 </version> <scope> test </seupop> </dependency> <dependency> <groupid> org.json </groupid> <ArTifactId> JSONENTID </ArtifactId> </Versi 2009021 </Groupid> <T/ArtifacTID> </ArtifactId> </ArtifactId </ArtifactID> </ArtifactId </ArtifactID> </ArtifactId> </ArtifactId> <finalname> feifei </finalname> </build> </poject>
2. Konstruksi Ide Konfigurasi Terkait Maven
.
Struktur paket proyek Maven
Siapkan panduan paket otomatis Maven
Di atas adalah semua konten artikel ini. Saya berharap ini akan membantu untuk pembelajaran semua orang dan saya harap semua orang akan lebih mendukung wulin.com.