達人シリーズ - マルチマルチモジュールのWebアプリケーションパッケージ合併戦争

複数のWeb Mavenのマルチモジュールアプリケーション・パッケージは、この部分を開始する前の章「Mavenのサブサブモジュールプロジェクト管理」の組み合わせを必要とするかどうかを確認するために、私のサブサブモジュールプロジェクト管理の書き込みの最後の章の基礎アップ合併戦争に基づいています。

私はこのプロジェクトの最上位の親は、5つのサブレベルのモジュールおよびエンジニアリングプロジェクトに分かれているんだ、プロジェクトが正常に確立されています。

私はgoodsmgrwebプロジェクトcustomermgrこのプロジェクトや顧客管理をJSファイルとそれに対応するプロジェクトに対応するファイル、JSPで新しいarchitecturewebをマージして作成したい、とそれぞれcustomermgr実行され、goodsmgrweb、単独のarchitecturewebモジュール、サブモジュールのmavenを見てみましょうパーティションのプロジェクト管理の利便性。

configure customermgr、その依存関係のgoodsmgrwebに1.architectureweb。

コード:

 

<dependencies>
		<dependency>
			<groupId>com.hxqc</groupId>
			<artifactId>customermgr</artifactId>
			<version>0.0.1-SNAPSHOT</version>
			<type>war</type>
		</dependency>
		<dependency>
			<groupId>com.hxqc</groupId>
			<artifactId>goodsmgrweb</artifactId>
			<version>0.0.1-SNAPSHOT</version>
			<type>war</type>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>3.8.1</version>
			<scope>test</scope>
		</dependency>
	</dependencies>
	<build>
		<finalName>architectureweb</finalName>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>3.0.0</version>
				<configuration>
					<overlays>
						<overlay>
							<groupId>com.hxqc</groupId>
							<artifactId>customermgr</artifactId>
						</overlay>
						<overlay>
							<groupId>com.hxqc</groupId>
							<artifactId>goodsmgrweb</artifactId>
						</overlay>
					</overlays>
				</configuration>
			</plugin>

 

 

 

 

 

共通の公開リソースモジュール2.その後、合併の効果を確認するための方法customermgrに新しいJavaクラスBASE1 BASE1を呼び出します。

customer1 customermgr新しいクラス3.その後、方法、他のJSP customermgr新しいファイル、フォルダ、JSを書いて、出力関連のメソッドを書き込みます。ファイルが多すぎ方法は、各JSやJSPファイルは主に効果を確認するために出力を書き込むことができます表示するものではありませんロックされました。

Customermgrは、以前のそれ以外の場合は、参照輸入BASE1クラスを文句を言うだろう、BASE1クラスの呼び出しJSPファイル内のメソッドの共通の際に、共通の依存性を注入しました。

中goodsmgrwebでの合併のルック依存効果と呼ばれる新しいgoods1クラス4.商品管理goodsmgrプロジェクト。

出力の一部を行うために商品管理goodsmgrweb管理ページ、新しいcustomermgrのJSに似ている、JSPファイル入力ファイルは、図1に示すプロジェクト構造で観察されました。

jspページ内のgoodsmgrwebでクラスやメソッドgoodsmgr内部コール財ので、ので、彼らはgoodsmgrweb注入goodsmgrそうでない場合は、JSPファイルのエラーになります。

6.プロジェクトの総建築右--->として実行--->次のようにarchitecturexプロジェクトが構成されているインストールのMaven。

一つだけを取る組み合わせ重複部分a.jspディレクトリファイルのサブモジュールを見つけるための時間が、ここでは取る時間に依存した構成の順です。

新しい治療法のサブモジュールのプロジェクト管理は、様々な文書を区別するので、ファイル名と同じパスの重複を避けるために。

7.プロジェクトを実行には、goodsmgrwebプロジェクト、architecturewebを実行しているたとえば、customermgr一例で同様のものを実行しません。

まず、桟橋のプラグインの設定にある設定goodsmgrwebのpom.xmlファイル。

 

<plugins>
	<plugin>
		<groupId>org.mortbay.jetty</groupId>
		<artifactId>jetty-maven-plugin</artifactId>
		<version>8.1.16.v20140903</version>
		<configuration>
			<scanIntervalSeconds>10</scanIntervalSeconds>
			<stopPort>9999</stopPort>
			<webApp>
				<contextPath>/goods</contextPath>
			</webApp>
		<connectors>
			<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
			        <port>9080</port>
			        <maxIdleTime>60000</maxIdleTime>
			</connector>
			<!-- <connector implementation="org.eclipse.jetty.server.ssl.SslSelectChannelConnector"> 
			<port>9443</port> <password>changeit</password> </connector> -->
			</connectors>
		</configuration>
	</plugin>
</plugins>

 

 

 

右键goodsmgrweb --->として実行--->実行構成(桟橋:実行)

成功した操作が表示されます。

 

[INFO] Classes = D:\Workspaces\architecture\goodsmgrweb\target\classes
[INFO] Context path = /goods
[INFO] Tmp directory = D:\Workspaces\architecture\goodsmgrweb\target\tmp
[INFO] Web defaults = org/eclipse/jetty/webapp/webdefault.xml
[INFO] Web overrides =  none
[INFO] web.xml file = file:/D:/Workspaces/architecture/goodsmgrweb/src/main/webapp/WEB-INF/web.xml
[INFO] Webapp directory = D:\Workspaces\architecture\goodsmgrweb\src\main\webapp
[INFO] jetty-8.1.16.v20140903
[INFO] No Transaction manager found - if your webapp requires one, please configure one.
[WARNING] !RequestLog
[INFO] Started [email protected]:9080
[INFO] Started Jetty Server
[INFO] Starting scanner at interval of 10 seconds.


そして、次のような効果がある参照してください。

 

 

 

 

 

公開された215元の記事 ウォンの賞賛135 ビュー114万+

おすすめ

転載: blog.csdn.net/weinichendian/article/details/62422188