1. 环境设置
1.1. Java环境设置
1)JAVA_HOME
D:\GreenSoftware\Java\Java8X64\jdk1.8.0_91
2)PATH
;%JAVA_HOME%/bin;%JAVA_HOME%/jre/bin
3)CLASSPATH
.;%JAVA_HOME%/lib;%JAVA_HOME%/lib/dt.jar;%JAVA_HOME%/lib/tools.jar
1.2. Mave环境设置
1.2.1. Maven环境变量
4)MAVEN_HOME
D:\GreenSoftware\apache-maven-3.0.5
5)PATH
;%MAVEN_HOME%/bin
1.2.2. Maven参数配置
修改“D:\GreenSoftware\apache-maven-3.0.5\conf\settings.xml”
(1)添加(红色部分)
<localRepository>D:/GreenSoftware/Java/repository</localRepository>
<profiles>
<profile>
<id>compiler</id>
<properties>
<JAVA_HOME>D:\GreenSoftware\Java\Java8X64\jdk1.8.0_91</JAVA_HOME>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>compiler</activeProfile>
</activeProfiles>
1.3. Eclipse环境设置
(1)
在Eclipse目录下的eclipse.ini文件开头加入如下代码:
-vm
D:/GreenSoftware/Java/Java8X64/jdk1.8.0_91/jre/bin/server/jvm.dll
(2)
(3)
(4)
1.4. Flex环境设置
(1)
将“flashplayer.exe”文件放入”C:\Windows”
(2)加入依赖包
agslib-3.6-2013-12-13.swc
mvn install:install-file -Dfile=agslib-3.6-2013-12-13.swc -DgroupId=com.esri -DartifactId=agslib -Dversion=3.6-2013-12-13 -Dpackaging=swc
agslib-2.5-2011-11-30
mvn install:install-file -Dfile=agslib-2.5-2011-11-30.swc -DgroupId=com.esri -DartifactId=agslib -Dversion=2.5-2011-11-30 -Dpackaging=swc
amCharts-4.0.swc
mvn install:install-file -Dfile=amCharts-4.0.swc -DgroupId=com.amcharts -DartifactId=amCharts -Dversion=4.0 -Dpackaging=swc
GifPlayer-1.0.swc
mvn install:install-file -Dfile=GifPlayer-1.0.swc -DgroupId=org.gif -DartifactId=GifPlayer -Dversion=1.0 -Dpackaging=swc
PlotAPI-4.0.swc
mvn install:install-file -Dfile=PlotAPI-4.0.swc -DgroupId=com.esrichina -DartifactId=PlotAPI -Dversion=4.0 -Dpackaging=swc
as3-signals-0.8.swc
mvn install:install-file -Dfile=as3-signals-0.8.swc -DgroupId=org.osflash -DartifactId=as3-signals -Dversion=0.8 -Dpackaging=swc
2. 工程构建
2.1. 生成工程结构
cd d:/Project/workspace/mete
mvn archetype:generate -DarchetypeRepository=http://repository.sonatype.org/content/groups/flexgroup -DarchetypeGroupId=org.sonatype.flexmojos -DarchetypeArtifactId=flexmojos-archetypes-modular-webapp -DarchetypeVersion=4.0-beta-3
Define value for property 'groupId': : com.summit.mete
Define value for property 'artifactId': : meteapp
Define value for property 'version': 1.0-SNAPSHOT: : 1.0
Define value for property 'package': com.summit.mete: : pom
2.2. 修改目录名
2.3. 修改pom.xml文件
1.4.1. 最外一层pom.xml
<?xml version="1.0"?>
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.summit.mete</groupId>
<artifactId>meteapp</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<flex.version>4.5.1.21328</flex.version>
<flex.theme>halo</flex.theme>
<flex.theme.type>swc</flex.theme.type>
<flex.tlf.version>2.0.0.232</flex.tlf.version>
<flex.osmf.version>1.0.0.16316</flex.osmf.version>
<flexmojos.version>4.2-beta</flexmojos.version>
</properties>
<modules>
<module>MapLab</module>
<module>MeteMap</module>
<module>MeteWeb</module>
</modules>
<dependencyManagement>
<!--
<dependencies>
<dependency>
<optional>true</optional>
<groupId>org.apache.flex.framework.themes</groupId>
<artifactId>${flex.theme}</artifactId>
<version>${flex.version}</version>
<type>${flex.theme.type}</type>
<scope>theme</scope>
</dependency>
</dependencies>
-->
</dependencyManagement>
<repositories>
<repository>
<id>flex-mojos-repository</id>
<url>http://repository.sonatype.org/content/groups/flexgroup</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>flex-mojos-plugin-repository</id>
<url>http://repository.sonatype.org/content/groups/flexgroup</url>
</pluginRepository>
</pluginRepositories>
</project>
1.4.2. MapLab/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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>meteapp</artifactId>
<groupId>com.summit.mete</groupId>
<version>1.0</version>
</parent>
<groupId>com.summit.mete</groupId>
<artifactId>MapLab</artifactId>
<version>1.0</version>
<packaging>swc</packaging>
<name>MapLab</name>
<properties>
<flex.linkReportAttach>false</flex.linkReportAttach>
</properties>
<build>
<sourceDirectory>src/main/flex</sourceDirectory>
<testSourceDirectory>src/test/flex</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>${flexmojos.version}</version>
<extensions>true</extensions>
<configuration>
<optimize>true</optimize>
<debug>false</debug>
<encoding>UTF-8</encoding>
<coverage>false</coverage>
<configurationReport>false</configurationReport>
<!--
<linkReportAttach>false</linkReportAttach>
<sizeReportAttach>false</sizeReportAttach>
<benchmark>false</benchmark>
-->
<locales>
<locale>zh_CN</locale>
</locales>
<themes>
<theme>${settings.localRepository}/com/adobe/flex/framework/spark/${flex.version}/spark-${flex.version}-theme.css</theme>
<theme>${project.build.sourceDirectory}/defaults.css</theme>
</themes>
</configuration>
<dependencies>
<dependency>
<groupId>com.adobe.flex</groupId>
<artifactId>compiler</artifactId>
<version>${flex.version}</version>
<type>pom</type>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>framework</artifactId>
<version>${flex.version}</version>
<type>swc</type>
<scope>caching</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>textLayout</artifactId>
<version>${flex.version}</version>
<type>swc</type>
<scope>caching</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>spark</artifactId>
<version>${flex.version}</version>
<type>swc</type>
<scope>caching</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>sparkskins</artifactId>
<version>${flex.version}</version>
<type>swc</type>
<scope>caching</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>rpc</artifactId>
<version>${flex.version}</version>
<type>swc</type>
<scope>caching</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>charts</artifactId>
<version>${flex.version}</version>
<type>swc</type>
<scope>caching</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>spark_dmv</artifactId>
<version>${flex.version}</version>
<type>swc</type>
<scope>caching</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>osmf</artifactId>
<version>${flex.version}</version>
<type>swc</type>
<scope>caching</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>mx</artifactId>
<version>${flex.version}</version>
<type>swc</type>
<scope>caching</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>advancedgrids</artifactId>
<version>${flex.version}</version>
<type>swc</type>
<scope>caching</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>flex-framework</artifactId>
<version>${flex.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.adobe.flex</groupId>
<artifactId>compiler</artifactId>
<version>${flex.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.adobe.flexunit</groupId>
<artifactId>flexunit</artifactId>
<version>0.85</version>
<type>swc</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>spark</artifactId>
<version>${flex.version}</version>
<classifier>theme</classifier>
<type>css</type>
<scope>theme</scope>
</dependency>
<dependency>
<groupId>com.esri</groupId>
<artifactId>agslib</artifactId>
<version>2.5-2011-11-30</version>
<type>swc</type>
</dependency>
<dependency>
<groupId>com.amcharts</groupId>
<artifactId>amCharts</artifactId>
<version>4.0</version>
<type>swc</type>
</dependency>
<dependency>
<groupId>org.gif</groupId>
<artifactId>GifPlayer</artifactId>
<version>1.0</version>
<type>swc</type>
</dependency>
<dependency>
<groupId>com.esrichina</groupId>
<artifactId>PlotAPI</artifactId>
<version>4.0</version>
<type>swc</type>
</dependency>
</dependencies>
</project>
1.4.3. MeteMap/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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.summit.mete</groupId>
<artifactId>meteapp</artifactId>
<version>1.0</version>
</parent>
<groupId>com.summit.mete</groupId>
<artifactId>MeteMap</artifactId>
<version>1.0</version>
<packaging>swf</packaging>
<name>MeteMap</name>
<properties>
</properties>
<build>
<sourceDirectory>src/main/flex</sourceDirectory>
<testSourceDirectory>src/test/flex</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>${flexmojos.version}</version>
<extensions>true</extensions>
<!-- -->
<configuration>
<optimize>true</optimize>
<debug>false</debug>
<encoding>UTF-8</encoding>
<coverage>false</coverage>
<configurationReport>false</configurationReport>
<!--
<linkReportAttach>false</linkReportAttach>
<sizeReportAttach>false</sizeReportAttach>
<benchmark>false</benchmark>
-->
<finalName>index</finalName>
<locales>
<locale>zh_CN</locale>
</locales>
<sourceFile>index.mxml</sourceFile>
<themes>
<theme>${settings.localRepository}/com/adobe/flex/framework/spark/${flex.version}/spark-${flex.version}-theme.css</theme>
<theme>${project.build.sourceDirectory}/defaults.css</theme>
</themes>
<!-- modules -->
<modules>
<module>
<sourceFile>widgets/panel/Head/HeadWidget.mxml</sourceFile>
<optimize>true</optimize>
<finalName>widgets/panel/Head/HeadWidget</finalName>
</module>
<module>
<sourceFile>widgets/panel/MainContainer/MainContainerWidget.mxml</sourceFile>
<optimize>true</optimize>
<finalName>widgets/panel/MainContainer/MainContainerWidget</finalName>
</module>
<module>
<sourceFile>widgets/panel/SystemMenu/SystemMenuWidget.mxml</sourceFile>
<optimize>true</optimize>
<finalName>widgets/panel/SystemMenu/SystemMenuWidget</finalName>
</module>
<module>
<sourceFile>widgets/ToolBar/ToolBarWidget.mxml</sourceFile>
<optimize>true</optimize>
<finalName>widgets/ToolBar/ToolBarWidget</finalName>
</module>
<module>
<sourceFile>widgets/LayerList/LayerListWidget.mxml</sourceFile>
<optimize>true</optimize>
<finalName>widgets/LayerList/LayerListWidget</finalName>
</module>
<module>
<sourceFile>widgets/Test/BaseModuleTest/BaseModuleTestWidget.mxml</sourceFile>
<optimize>true</optimize>
<finalName>widgets/Test/BaseModuleTest/BaseModuleTestWidget</finalName>
</module>
<module>
<sourceFile>widgets/Test/BaseWidgetTest/BaseWidgetTestWidget.mxml</sourceFile>
<optimize>true</optimize>
<finalName>widgets/Test/BaseWidgetTest/BaseWidgetTestWidget</finalName>
</module>
</modules>
</configuration>
<dependencies>
<dependency>
<groupId>com.adobe.flex</groupId>
<artifactId>compiler</artifactId>
<version>${flex.version}</version>
<type>pom</type>
</dependency>
</dependencies>
<executions>
<execution>
<goals>
<goal>wrapper</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<versionRange>[3.9,)</versionRange>
<goals>
<goal>test-compile</goal>
<goal>compile-swf</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencies>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>framework</artifactId>
<version>${flex.version}</version>
<type>swc</type>
<scope>caching</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>textLayout</artifactId>
<version>${flex.version}</version>
<type>swc</type>
<scope>caching</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>spark</artifactId>
<version>${flex.version}</version>
<type>swc</type>
<scope>caching</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>sparkskins</artifactId>
<version>${flex.version}</version>
<type>swc</type>
<scope>caching</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>rpc</artifactId>
<version>${flex.version}</version>
<type>swc</type>
<scope>caching</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>charts</artifactId>
<version>${flex.version}</version>
<type>swc</type>
<scope>caching</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>spark_dmv</artifactId>
<version>${flex.version}</version>
<type>swc</type>
<scope>caching</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>osmf</artifactId>
<version>${flex.version}</version>
<type>swc</type>
<scope>caching</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>mx</artifactId>
<version>${flex.version}</version>
<type>swc</type>
<scope>caching</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>advancedgrids</artifactId>
<version>${flex.version}</version>
<type>swc</type>
<scope>caching</scope>
</dependency>
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>flex-framework</artifactId>
<version>${flex.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.adobe.flex</groupId>
<artifactId>compiler</artifactId>
<version>${flex.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.adobe.flexunit</groupId>
<artifactId>flexunit</artifactId>
<version>0.85</version>
<type>swc</type>
<scope>test</scope>
</dependency>
<!-- THEMES -->
<dependency>
<groupId>com.adobe.flex.framework</groupId>
<artifactId>spark</artifactId>
<version>${flex.version}</version>
<classifier>theme</classifier>
<type>css</type>
<scope>theme</scope>
</dependency>
<dependency>
<groupId>com.esri</groupId>
<artifactId>agslib</artifactId>
<version>2.5-2011-11-30</version>
<type>swc</type>
</dependency>
<dependency>
<groupId>com.amcharts</groupId>
<artifactId>amCharts</artifactId>
<version>4.0</version>
<type>swc</type>
</dependency>
<dependency>
<groupId>org.gif</groupId>
<artifactId>GifPlayer</artifactId>
<version>1.0</version>
<type>swc</type>
</dependency>
<dependency>
<groupId>com.esrichina</groupId>
<artifactId>PlotAPI</artifactId>
<version>4.0</version>
<type>swc</type>
</dependency>
<dependency>
<groupId>com.summit.mete</groupId>
<artifactId>MapLab</artifactId>
<version>1.0</version>
<type>swc</type>
</dependency>
</dependencies>
</project>
1.4.4. MeteWeb/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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>meteapp</artifactId>
<groupId>com.summit.mete</groupId>
<version>1.0</version>
</parent>
<groupId>com.summit.mete</groupId>
<artifactId>MeteWeb</artifactId>
<version>1.0</version>
<packaging>war</packaging>
<properties>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>${flexmojos.version}</version>
<extensions>true</extensions>
<configuration>
<policyFileUrls>
<url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</url>
<url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</url>
<url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</url>
</policyFileUrls>
<rslUrls>
<url>http://fpdownload.adobe.com/pub/{extension}/flex/${flex.version}/{artifactId}_{version}.{extension}</url>
<url>http://fpdownload.adobe.com/pub/{extension}/tlf/${flex.tlf.version}/{artifactId}_${flex.tlf.version}.{extension}</url>
<url>http://fpdownload.adobe.com/pub/{extension}/flex/${flex.version}/{artifactId}_${flex.osmf.version}.{extension}</url>
</rslUrls>
</configuration>
<executions>
<execution>
<goals>
<goal>copy-flex-resources</goal>
</goals>
<configuration>
<encoding>UTF-8</encoding>
<configurationReport>false</configurationReport>
<webappDirectory>${basedir}/src/main/webapp/gis</webappDirectory>
<storepass/>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<encoding>UTF-8</encoding>
<outputDirectory>${basedir}/src/main/webapp/gis</outputDirectory>
<resources>
<resource>
<directory>${basedir}/../MeteMap/src/main/flex</directory>
<excludes>
<exclude>**/*.mxml</exclude>
<exclude>**/*.as</exclude>
<exclude>**/*.css</exclude>
</excludes>
<filtering>false</filtering>
</resource>
<resource>
<directory>${basedir}/../MeteMap/target</directory>
<includes>
<include>**/*.swf</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>8.1.16.v20140903</version>
</plugin>
</plugins>
</build>
<dependencies>
<!--
<dependency>
<groupId>com.summit.mete</groupId>
<artifactId>MeteMap</artifactId>
<version>1.0</version>
<type>swf</type>
</dependency>
-->
</dependencies>
</project>
2.4. 生成FlashBuilder工程
1.4.5. 执行命令生成FlashBuilder工程
cd d:/Project/workspace/mete/MeteMap
mvn org.sonatype.flexmojos:flexmojos-maven-plugin:3.9:flashbuilder
1.4.6. 在FlashBuilder中添加模块
2.5. 生成Eclipse工程
1.4.7. 1.修改MeteWeb/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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>meteapp</artifactId>
<groupId>com.summit.mete</groupId>
<version>1.0</version>
</parent>
<artifactId>MeteWeb</artifactId>
<packaging>war</packaging>
<name>MeteWeb</name>
<properties>
<jdbc.host>127.0.0.1</jdbc.host>
<jdbc.port>3306</jdbc.port>
<jdbc.databaseName>ucplite</jdbc.databaseName>
<jdbc.user>root</jdbc.user>
<jdbc.password>gis</jdbc.password>
<!-- version -->
<jstl.version>1.2</jstl.version>
<junit.version>4.12</junit.version>
<spring.version>4.2.6.RELEASE</spring.version>
<servlet.version>3.0.1</servlet.version>
<jsp.version>2.2</jsp.version>
<tomcat.plugin.version>2.2</tomcat.plugin.version>
<spring.security.version>4.1.0.RELEASE</spring.security.version>
<lombok.version>1.14.8</lombok.version>
<log4j.version>1.2.17</log4j.version>
<slf4j.version>1.7.21</slf4j.version>
<org.json.version>20090211</org.json.version>
<common.dbcp.verison>1.4</common.dbcp.verison>
<commmons.pool.version>1.6</commmons.pool.version>
<commmons.collections.version>3.2.1</commmons.collections.version>
<commons.fileupload.version>1.2.1</commons.fileupload.version>
<commons.io.version>2.4</commons.io.version>
<mysql.connector.verison>5.1.6</mysql.connector.verison>
<!-- Encoding -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
</properties>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
<testSourceDirectory>src/test/flex</testSourceDirectory>
</build>
<profiles>
<profile>
<id>devApp</id>
<build>
<finalName>MeteWeb</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.10</version>
<!--
<configuration>
<wtpversion>2.0</wtpversion>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
-->
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>${tomcat.plugin.version}</version>
<configuration>
<port>8080</port>
<path>/gisservice</path>
<uriEncoding>UTF-8</uriEncoding>
<url>http://localhost:8080/manager/html</url>
<server>tomcat7</server>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<showWarnings>true</showWarnings>
<encoding>UTF-8</encoding>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>8.1.16.v20140903</version>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>depApp</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>com.summit.mete</groupId>
<artifactId>index</artifactId>
<version>1.0</version>
<type>swf</type>
</dependency>
</dependencies>
<build>
<finalName>MeteWeb</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>${flexmojos.version}</version>
<extensions>true</extensions>
<configuration>
<policyFileUrls>
<url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</url>
<url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</url>
<url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</url>
</policyFileUrls>
<rslUrls>
<url>http://fpdownload.adobe.com/pub/{extension}/flex/${flex.version}/{artifactId}_{version}.{extension}</url>
<url>http://fpdownload.adobe.com/pub/{extension}/tlf/${flex.tlf.version}/{artifactId}_${flex.tlf.version}.{extension}</url>
<url>http://fpdownload.adobe.com/pub/{extension}/flex/${flex.version}/{artifactId}_${flex.osmf.version}.{extension}</url>
</rslUrls>
</configuration>
<executions>
<execution>
<goals>
<goal>copy-flex-resources</goal>
</goals>
<configuration>
<encoding>UTF-8</encoding>
<configurationReport>false</configurationReport>
<webappDirectory>${basedir}/src/main/webapp/gis</webappDirectory>
<storepass/>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<encoding>UTF-8</encoding>
<outputDirectory>${basedir}/src/main/webapp/gis</outputDirectory>
<resources>
<resource>
<directory>${basedir}/../MeteMap/src/main/flex</directory>
<excludes>
<exclude>**/*.mxml</exclude>
<exclude>**/*.as</exclude>
<exclude>**/*.css</exclude>
</excludes>
<filtering>false</filtering>
</resource>
<resource>
<directory>${basedir}/../MeteMap/target</directory>
<includes>
<include>**/*.swf</include>
</includes>
<filtering>false</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.10</version>
<!--
<configuration>
<wtpversion>2.0</wtpversion>
<downloadSources>true</downloadSources>
<downloadJavadocs>true</downloadJavadocs>
</configuration>
-->
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>${tomcat.plugin.version}</version>
<configuration>
<port>8080</port>
<path>/gisservice</path>
<uriEncoding>UTF-8</uriEncoding>
<url>http://localhost:8080/manager/html</url>
<server>tomcat7</server>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<showWarnings>true</showWarnings>
<encoding>UTF-8</encoding>
<!--
<compilerArgument>-parameters</compilerArgument>
-->
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>8.1.16.v20140903</version>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<versionRange>[4.2-beta,)</versionRange>
<goals>
<goal>copy-flex-resources</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore/>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- JSP JSTL -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.0-b01</version>
<scope>provided</scope>
</dependency>
<!--
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>${jsp.version}</version>
<scope>provided</scope>
</dependency>
-->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>${jstl.version}</version>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
<!--
<type>jar</type>
<scope>compile</scope>
-->
</dependency>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
<exclusions>
<!-- Exclude Commons Logging in favor of SLF4j -->
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- spring webmvc相关jar包 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- spring security configuration -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${spring.security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${spring.security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>${spring.security.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-dbcp2</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-pool2</artifactId>
<version>2.4.2</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.11</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>
<!-- spring test -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- log4j -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>${log4j.version}</version>
<exclusions>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
</exclusion>
</exclusions>
<!-- 将scope修改为compile 解决 软件包 org.apache.log4j 不存在问题 -->
<!-- <scope>runtime</scope> -->
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
<scope>runtime</scope>
</dependency>
<!-- org json -->
<!--
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>${org.json.version}</version>
</dependency>
-->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.5.3</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>2.5.3</version>
</dependency>
<!-- mysql -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.connector.verison}</version>
</dependency>
<dependency>
<groupId>com.vividsolutions</groupId>
<artifactId>jts</artifactId>
<version>1.13</version>
</dependency>
</dependencies>
</project>
1.4.8. 执行命令生成Eclipse工程
cd d:/Project/workspace/mete/MeteWeb
mvn eclipse:eclipse
命令执行完成后,在Eclipse中导入MeteWeb工程
1.4.9. Eclipse中MeteWeb模块调试设置
1.4.10. Eclipse中MeteApp工程编译打包设置
3. Maven技术参照
http://maven.apache.org/ref/3.0.3/maven-model/apidocs/index.html
http://maven.apache.org/guides/introduction/introduction-todependency-mechanism.html
3.1. 内部变量
${project.name} |
||
${project.parent.groupId} |
||
${project.build.sourceEncoding} |
||
${settings.localRepository} |
||
${env.JAVA_HOME}; |
||
${java.class.path} |
||
${java.version} |
||
${user.home} |
||
${user.name} |
||
3.2. 常用插件
phase |
goals |
||
maven-compiler-plugin |
Maven compiler plugin |
Maven core phases (clean, compile, test, and so on.) |
compiler:compile compiler:testCompile |
maven-surefire-plugin |
run unit tests |
test |
surefire:test |
maven-enforcer-plugin |
define environmental conditions |
validate |
enforcer:enforce enforcer:display-info |
maven-war-plugin |
redefined in our web POMs |
||
maven-checkstyle-plugin |
|||
Eclipse开发环境设置(Maven+Spring MVC+Flex)的更多相关文章
-
使用IntelliJ IDEA和Maven管理搭建Web开发环境(以Spring MVC为例)(二)
前言:在使用IntelliJ IDEA和Maven管理搭建Web开发环境(以Spring MVC为例)(一)中已经介绍了如何对web基础环境进行搭建,这里主要演示,如何对spring环境进行搭建,然后 ...
-
使用IntelliJ IDEA和Maven管理搭建Web开发环境(以Spring MVC为例)(一)
前言:原来一直使用MyEclipse,换工作后,新公司使用IDEA,初识IDEA发现,哇,它的快捷键可真多啊,但是一路用下来,觉得非常的好用,特别是利用Maven管理,那简直叫一个爽.当然笔者在使用过 ...
-
Hadoop集群 -Eclipse开发环境设置
1.Hadoop开发环境简介 1.1 Hadoop集群简介 Java版本:jdk-6u31-linux-i586.bin Linux系统:CentOS6.0 Hadoop版本:hadoop-1.0.0 ...
-
Hadoop集群(第7期)_Eclipse开发环境设置
1.Hadoop开发环境简介 1.1 Hadoop集群简介 Java版本:jdk-6u31-linux-i586.bin Linux系统:CentOS6.0 Hadoop版本:hadoop-1.0.0 ...
-
IntelliJ IDEA上创建maven Spring MVC项目
IntelliJ IDEA上创建Maven Spring MVC项目 各软件版本 利用maven骨架建立一个webapp 建立相应的目录 配置Maven和SpringMVC 配置Maven的pom.x ...
-
maven Spring MVC项目
IntelliJ IDEA上创建maven Spring MVC项目 各软件版本 利用maven骨架建立一个webapp 建立相应的目录 配置Maven和SpringMVC 配置Maven的pom.x ...
-
Eclipse开发环境配置,打磨Eclipse,安装插件(适用3.4,3.5,3.6,3.7)
转载自:http://elf8848.iteye.com/blog/354035 打磨Eclipse -- 磨刀不误砍柴工 -------------------------------------- ...
-
突破瓶颈,对比学习:Eclipse开发环境与VS开发环境的调试对比
曾经看了不少Java和Android的相关知识,不过光看不练易失忆,所以,还是写点文字,除了加强下记忆,也证明我曾经学过~~~ 突破瓶颈,对比学习: 学习一门语言,开发环境很重,对于VS的方形线条开发 ...
-
zookeeper Eclipse 开发环境搭建及简单示例
一,下载Zookeeper安装包 从官方网站下载稳定版安装包后,解压. 其中ZK_HOME 为:D:\Program Files\zookeeper-3.4.9 二,启动Zookeeper Serve ...
随机推荐
-
最大连续子序列乘积(DP)
题目来源:小米手机2013年校园招聘笔试题 题目描述: 给定一个浮点数序列(可能有正数.0和负数),求出一个最大的连续子序列乘积. 输入: 输入可能包含多个测试样例.每个测试样例的第一行仅包含正整数 ...
-
[Visual Studio]项目属性中继承的值怎么删除
遇到一个问题,莫名奇妙编译,却出错"找不到包含文件<winapifamily.h>",之前从没出过问题啊!百思不得其解. 研究包含winapifamily的位置,发现有 ...
-
wp8 入门到精通 ---转换
/// <summary> /// 颜色字符串转Color /// </summary> public static ...
-
IIS减少工作线程阻塞的方法
IIS的工作进程(w3wp.exe)只提供了有限的工作线程(Work Thread)来处理请求.如果这些线程都因为要等待长时间运行的任务而阻塞,则运行时会将新来的请求排队,而不是立即执行,Web服务器 ...
-
hadoop wordcount
Mapper // map的数量与数的分片有关系 public class WCMapper extends Mapper<LongWritable, Text, Text, LongWrita ...
-
IEnumerable 接口 实现foreach 遍历 实例
额 为啥写着东西? 有次面试去,因为用到的时候特别少 所以没记住, 这个单词 怎么写! 经典的面试题: 能用foreach遍历访问的对象的要求? 答: 该类实现IEnumetable 接口 声明 ...
-
ios9API基础知识总结(二)
UIAlertView(警告框) UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"标题" message:@&qu ...
-
iOS 生成随机颜色(UIColor)
#import <UIKit/UIKit.h> @interface UIColor (RandomColor) +(UIColor *) randomColor; @end #impor ...
-
js 将long日期格式 转换为标准日期格式方法
我们经常在操作的时候会发现从后台传递到view层的json中datetime类型变成了long型,当然你也可以从后台先转为string类型,但是如果是从和数据库对应的object中封装的话,就不能再去 ...
-
iOS开发者的福利 — — iOS9+Xcode7免越狱免证书直接调试
苹果发布Xcode7后, 开放了普通的AppleID也能真机调试( 非$99 或 $299, 只要能上AppStore下载应用的AppleID就行),下面教你具体做法,很简单的. 1.运行Xcode, ...