探讨Java技术,努力学习,分享心得

我不是技术控,拿来主义其实也挺好,但是一定要有自己的想法

统计

留言簿

阅读排行榜

评论排行榜

2015年2月10日 #

Maven的工程目录结构

pom.xml 的参照模型

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.brms.governor</groupId>
<artifactId>brms-governor</artifactId>
<version>0.9.0</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java-version>1.6</java-version>
<java-encoding>UTF-8</java-encoding>
<dpap-version>1.1.2</dpap-version>
<brms-server-version>0.9.0</brms-server-version>
<brms-governor-version>0.9.0</brms-governor-version>
<wro4j-version>1.6.3</wro4j-version>
<wro4j-minimize>false</wro4j-minimize>
<mybatis-version>3.0.5</mybatis-version>
<mybatis-spring-version>1.0.1</mybatis-spring-version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.brms.server</groupId>
<artifactId>brms-server-base</artifactId>
<version>${brms-server-version}</version>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>2.1.0</version>
<exclusions>
<exclusion>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
<version>1.1.1.RELEASE</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jsp-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>oracle</groupId>
<artifactId>oracle-jdbc</artifactId>
<version>10.1.0.2.0</version>
<scope>test</scope>
</dependency>
<!-- mybatis 坐标 -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>${mybatis-version}</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>${mybatis-spring-version}</version>
</dependency>
<!-- DPAP framework start -->
<dependency>
<groupId>com</groupId>
<artifactId>framework-shared</artifactId>
<version>${dpap-version}</version>
</dependency>
<dependency>
<groupId>com</groupId>
<artifactId>framework-server</artifactId>
<version>${dpap-version}</version>
<exclusions>
<exclusion>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com</groupId>
<artifactId>framework-sso</artifactId>
<version>${dpap-version}</version>
</dependency>
<dependency>
<groupId>org.lazyluke</groupId>
<artifactId>log4jdbc-remix</artifactId>
<version>0.2.7</version>
</dependency>
<!-- DPAP framework end -->
</dependencies>
</dependencyManagement>
<distributionManagement>
<repository>
<id>releases</id>
<name>release repository</name>
<url>http://私服:端口/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>snapshot repository</name>
<url>http://私服:端口/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-maven-plugin</artifactId>
<versionRange>[1.6.0,)</versionRange>
<goals>
<goal>run</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
<plugin>
<groupId>ro.isdc.wro4j</groupId>
<artifactId>wro4j-maven-plugin</artifactId>
<version>${wro4j-version}</version>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<configuration>
<minimize>${wro4j-minimize}</minimize>
<extraConfigFile>${basedir}/src/main/resources/com/module/${moduleContext}/server/META-INF/wro.properties</extraConfigFile>
<wroManagerFactory>ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory</wroManagerFactory>
<cssDestinationFolder>${project.build.directory}/classes/com/module/${moduleContext}/server/META-INF/styles/wro/</cssDestinationFolder>
<jsDestinationFolder>${project.build.directory}/classes/com/module/${moduleContext}/server/META-INF/scripts/wro/</jsDestinationFolder>
<wroFile>${basedir}/src/main/resources/com/module/${moduleContext}/server/META-INF/wro.xml</wroFile>
<groupNameMappingFile>${project.build.directory}/classes/com/module/${moduleContext}/server/META-INF/wromapping.properties</groupNameMappingFile>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat6-maven-plugin</artifactId>
<version>2.1</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.1</version>
<configuration>
<attach>true</attach>
<encoding>UTF-8</encoding>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>${java-version}</source>
<target>${java-version}</target>
<encoding>${java-encoding}</encoding>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>dev</id>
<properties>
<staticServer>http://静态资源服务器/dpap/dpap</staticServer>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<directory>src/main/webapp</directory>
<includes>
<include>WEB-INF/web.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>normal</id>
<properties>
<staticServer>http://静态资源服务器/dpap/dpap</staticServer>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<directory>src/main/webapp</directory>
<includes>
<include>WEB-INF/web.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>sit</id>
<properties>
<staticServer>http://静态资源服务器/dpap/dpap</staticServer>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<directory>src/main/webapp</directory>
<includes>
<include>WEB-INF/web.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>prd</id>
<properties>
<staticServer>http://静态资源服务器/dpap/foss</staticServer>
</properties>
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<webResources>
<resource>
<directory>src/main/webapp</directory>
<includes>
<include>WEB-INF/web.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<modules>
<module>common-login</module>
<module>common-sysconfig</module>
<module>common-frameworkimpl</module>
<module>common-dict</module>
<module>common-monitor</module>
<module>common-message</module>
<module>common-sync</module>
<module>common-authorization</module>
</modules>
</project>

posted @ 2015-02-10 17:07 瞿祥军 阅读(626) | 评论 (0)编辑 收藏