设为首页 收藏本站
查看: 834|回复: 0

[经验分享] Eclipse开发环境设置(Maven+Spring MVC+Flex)

[复制链接]

尚未签到

发表于 2017-3-2 11:48:57 | 显示全部楼层 |阅读模式
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)
DSC0000.png

  (3)
DSC0001.png

  (4)
DSC0002.png

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
DSC0003.png

2.2. 修改目录名
DSC0004.png

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中添加模块
DSC0005.png

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模块调试设置
DSC0006.png

1.4.10. Eclipse中MeteApp工程编译打包设置
DSC0007.png

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

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-349290-1-1.html 上篇帖子: JPress,一个wordpress的java代替版本 下篇帖子: ActiveMQ 用户名密码设置
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表