Apache-tapestry-project-layout

提供:Dev Guides
移動先:案内検索

Apacheタペストリー-プロジェクトレイアウト

以下は、 Maven Quickstart CLI によって作成されたソースコードのレイアウトです。 また、これは標準のTapestryアプリケーションの推奨レイアウトです。

├── build.gradle
├── gradle
│   └── wrapper
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── pom.xml
├── src
│   ├── main
│   │   ├── java
│   │   │   └── com
│   │   │       └── example
│   │   │           └── MyFirstApplication
│   │   │               ├── components
│   │   │               ├── data
│   │   │               ├── entities
│   │   │               ├── pages
│   │   │               └── services
│   │   ├── resources
│   │   │   ├── com
│   │   │   │   └── example
│   │   │   │       └── MyFirstApplication
│   │   │   │           ├── components
│   │   │   │           ├── logback.xml
│   │   │   │           └── pages
│   │   │   │               └── Index.properties
│   │   │   ├── hibernate.cfg.xml
│   │   │   └── log4j.properties
│   │   └── webapp
│   │       ├── favicon.ico
│   │       ├── images
│   │       │   └── tapestry.png
│   │       ├── mybootstrap
│   │       │   ├── css
│   │       │   │   ├── bootstrap.css
│   │       │   │   └── bootstrap-theme.css
│   │       │   ├── fonts
│                   ├── glyphicons-halflings-regular.eot
│   │       │   │   ├── glyphicons-halflings-regular.svg
│   │       │   │   ├── glyphicons-halflings-regular.ttf
│   │       │   │   ├── glyphicons-halflings-regular.woff
│   │       │   │   └── glyphicons-halflings-regular.woff2
│   │       │   └── js
│   │       └── WEB-INF
│   │           ├── app.properties
│   │           └── web.xml
│   ├── site
│   │   ├── apt
│   │   │   └── index.apt
│   │   └── site.xml
│   └── test
│       ├── conf
│       │   ├── testng.xml
│       │   └── webdefault.xml
│       ├── java
│       │   └── PLACEHOLDER
│       └── resources
│           └── PLACEHOLDER
└── target
   ├── classes
   │   ├── com
   │   │   └── example
   │   │       └── MyFirstApplication
   │   │           ├── components
   │   │           ├── data
   │   │           ├── entities
   │   │           ├── logback.xml
   │   │           ├── pages
   │   │           │   └── Index.properties
   │   │           └── services
   │   ├── hibernate.cfg.xml
   │   └── log4j.properties
   ├── m2e-wtp
   │   └── web-resources
   │       └── META-INF
   │           ├── MANIFEST.MF
   │           └── maven
   │               └── com.example
   │                   └──MyFirstApplication
   │                     ├── pom.properties
   │                       └── pom.xml
   ├── test-classes
   │   └── PLACEHOLDER
   └── work
      ├── jsp
      ├── sampleapp.properties
      └── sampleapp.script

デフォルトのレイアウトは、 WAR Internal File Format のように配置されます。 WAR形式を使用すると、パッケージ化およびデプロイせずにアプリケーションを実行できます。 このレイアウトは単なる提案ですが、展開中に適切なWAR形式にパッケージ化されている場合、アプリケーションは任意の形式で配置できます。

ソースコードは、次の4つの主要なセクションに分割できます。

  • * Javaコード*-すべてのJavaソースコードは /src/main/java フォルダーに配置されます。 Tapestryページクラスは「Pages」フォルダーの下に配置され、Tapestryコンポーネントクラスはcomponentsフォルダーの下に配置されます。 タペストリーサービスクラスは、servicesフォルダーの下に配置されます。
  • * ClassPathリソース*-Tapestryでは、ほとんどのクラスにリソース(XMLテンプレート、JavaScriptファイルなど)が関連付けられています。 これらのリソースは /src/main/resources フォルダーの下に配置されます。 Tapestryページクラスには「Pages」フォルダーの下に関連リソースがあり、TapestryコンポーネントクラスにはComponentsフォルダーの下に関連リソースがあります。 これらのリソースは、WARの WEB-INF/classes フォルダーにパッケージ化されています。
  • コンテキストリソース-画像、スタイルシート、JavaScriptライブラリなどのWebアプリケーションの静的リソース /モジュール。 それらは通常/src/main/webapp フォルダーの下に置かれ、 Context Resources と呼ばれます。 また、(Javaサーブレットの)Webアプリケーション記述ファイルweb.xmlは、コンテキストリソースの WEB-INF フォルダーの下に配置されます。
  • テストコード-これらはアプリケーションのテストに使用されるオプションのファイルで、 src/test/java および* src/test/ * Resourcesフォルダーの下に配置されます。 それらはWARにパッケージ化されていません。