Eclipse开发环境设置(Maven+Spring MVC+Flex)

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

     
       
       
       
       
       
       
时间: 2024-10-31 15:57:22

Eclipse开发环境设置(Maven+Spring MVC+Flex)的相关文章

hadoop搭建与eclipse开发环境设置

hadoop搭建与eclipse开发环境设置(转) 1.    Windows下eclipse开发环境配置 1.1 安装开发hadoop插件 将hadoop安装包hadoop\contrib\eclipse-plugin\hadoop-0.20.2-eclipse-plugin.jar拷贝到eclipse的插件目录plugins下. 需要注意的是插件版本(及后面开发导入的所有jar包)与运行的hadoop一致,否则可能会出现EOFException异常. 重启eclipse,打开windows-

Hadoop集群 -Eclipse开发环境设置

1.Hadoop开发环境简介 1.1 Hadoop集群简介 Java版本:jdk-6u31-linux-i586.bin Linux系统:CentOS6.0 Hadoop版本:hadoop-1.0.0.tar.gz 1.2 Windows开发简介 Java版本:jdk-6u31-windows-i586.exe Win系统:Windows 7 旗舰版 Eclipse软件:eclipse-jee-indigo-SR1-win32.zip | eclipse-jee-helios-SR2-win32

Hadoop集群(第7期)_Eclipse开发环境设置

1.Hadoop开发环境简介 1.1 Hadoop集群简介 Java版本:jdk-6u31-linux-i586.bin Linux系统:CentOS6.0 Hadoop版本:hadoop-1.0.0.tar.gz 1.2 Windows开发简介 Java版本:jdk-6u31-windows-i586.exe Win系统:Windows 7 旗舰版 Eclipse软件:eclipse-jee-indigo-SR1-win32.zip | eclipse-jee-helios-SR2-win32

Hadoop集群_Eclipse开发环境设置

1.Hadoop开发环境简介 1.1 Hadoop集群简介 Java版本:jdk-6u31-linux-i586.bin Linux系统:CentOS6.0 Hadoop版本:hadoop-1.0.0.tar.gz 1.2 Windows开发简介 Java版本:jdk-6u31-windows-i586.exe Win系统:Windows 7 旗舰版 Eclipse软件:eclipse-jee-indigo-SR1-win32.zip | eclipse-jee-helios-SR2-win32

maven Spring MVC项目

IntelliJ IDEA上创建maven Spring MVC项目 各软件版本 利用maven骨架建立一个webapp 建立相应的目录 配置Maven和SpringMVC 配置Maven的pom.xml 配置web.xml 配置contextConfigLocation文件 配置log4j.properties controller和view的编写 servlet容器的配置和运行 配置本地的tomcat服务器 配置maven插件 运行第一个Spring MVC应用 目前java开发主流的IDE

MAC下Android的Eclipse开发环境的搭建

一.Eclipse的下载 到网站:http://www.eclipse.org/downloads/ 上,由于我们是用Java开发的所以步骤如下: 找到"Eclipse IDE for java Developers"此处右上角会根据你当前使用的系统自动选择,Mac下就会自动选择位"Mac OS X(Cocoa)" 然后点击右边的"Mac OS X 64bit"(这里我的Pro是i5处理器可以用64位的),根据你的机器也可以选择"Mac

iDempiere 使用指南 windows下eclipse开发环境配置及打包下载

Created by 蓝色布鲁斯,QQ32876341,blog http://www.cnblogs.com/zzyan/ iDempiere官方中文wiki主页 http://wiki.idempiere.org/zhiDempiere 中文社区www.idempiere.org.cniDempiere 中文社区QQ群 65713012 本文说明如何在windows下面配置iDempiere的eclipse 开发环境,同时提供配置好的环境下载.请同时参照第一篇 绿色版iDempiere环境

Go语言Eclipse开发环境配置-windows

1.首先安装eclipse,选择一个适合的版本就好,解压即可 http://www.eclipse.org/downloads/ 2.下载go语言安装包 官网地址 :http://www.golang.org/ 官网地址有时候打不开,百度云盘下载go1.2安装包  http://pan.baidu.com/s/1c0Gf4UO#dir/path=%2FSoft%2FGoLang  32 64位都有 一路Next cmd输入go version 看到这个就安装好了,环境变量什么的会自动配置好的,唯

Visual Studio下SQLite数据库开发环境设置

因为我们介绍的内容都是基于微软的Visual Studio下开发的Win32平台,所以下边我们介绍Visual Studio下SQLite数据库开发环境设置. 详细而言我们有两种方式能够在Visual Studio中SQLite数据库:使用SQLite源码文件和使用Cocos2d-x提供的库文件.1.使用SQLite源码文件SQLite是C编写的开源的数据库,我们能够在http://www.sqlite.org/download.html网址下载最新的SQLite源码,如我下载的sqlite-a