dubbo Java parent通用配置,Eclipse項目處理中遇到的問題

edu-common-parent->pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>

   <groupId>wusc.edu.common</groupId>
   <artifactId>edu-common-parent</artifactId>
   <version>1.0-SNAPSHOT</version>
   <packaging>pom</packaging>

   <name>edu-common-parent</name>
   <url>http://maven.apache.org</url>

edu-demo中引用 edu-common-parent->pom.xml
<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>wusc.edu.common</groupId>
      <artifactId>edu-common-parent</artifactId>
      <version>1.0-SNAPSHOT</version>
      <relativePath>../edu-common-parent</relativePath>
   </parent>

   <groupId>wusc.edu.demo</groupId>
   <artifactId>edu-demo</artifactId>
   <version>${edu-demo.version}</version>
   <packaging>war</packaging>

   <name>edu-demo</name>
   <url>http://maven.apache.org</url>








父pom.xml文件,部分修改如下,適應於新版本dubbo

 

<properties>
   <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

   <edu-demo.version>1.0-SNAPSHOT</edu-demo.version>
   <edu-facade-user.version>1.0-SNAPSHOT</edu-facade-user.version>
   <edu-service-user.version>1.0-SNAPSHOT</edu-service-user.version>
   <edu-web-boss.version>1.0-SNAPSHOT</edu-web-boss.version>


   <org.springframework.version>3.2.4.RELEASE</org.springframework.version>
   <org.apache.struts.version>2.3.15.1</org.apache.struts.version>
      <source.level>1.8</source.level>
       <target.level>1.8</target.level>
       <dubbo.version>2.7.5</dubbo.version>
       <spring.version>4.3.16.RELEASE</spring.version>
       <junit.version>4.12</junit.version>
       <docker-maven-plugin.version>0.30.0</docker-maven-plugin.version>
       <jib-maven-plugin.version>1.2.0</jib-maven-plugin.version>
       <maven-compiler-plugin.version>3.7.0</maven-compiler-plugin.version>
       <maven-failsafe-plugin.version>2.21.0</maven-failsafe-plugin.version>
       <image.name>${project.artifactId}:${dubbo.version}</image.name>
       <java-image.name>openjdk:8</java-image.name>
       <dubbo.port>20880</dubbo.port>
</properties>
src->main->resources->spring-dubbo-provider.xml文件,由於阿里官網關閉,需要修改如下內容
xmlns:dubbo的內容必須與下列兩處相同
xmlns:dubbo="http://dubbo.apache.org/schema/dubbo"
http://dubbo.apache.org/schema/dubbo
http://dubbo.apache.org/schema/dubbo/dubbo.xsd

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://dubbo.apache.org/schema/dubbo"
   xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans.xsd
            http://dubbo.apache.org/schema/dubbo
            http://dubbo.apache.org/schema/dubbo/dubbo.xsd"> ,可以下載,Eclipse中加入也可以

   <!-- 提供方應用信息,用於計算依賴關係 -->
   <dubbo:application name="gw-service-user" />

   <!-- 使用zookeeper註冊中心暴露服務地址 -->
   <dubbo:registry protocol="zookeeper" address="192.168.3.71:2181" />

   <!-- 用dubbo協議在20880端口暴露服務 -->
   <dubbo:protocol name="dubbo" port="20880" />

   <!-- 用戶服務接口 -->
   <dubbo:service interface="wusc.edu.facade.user.service.PmsUserFacade" ref="pmsUserFacade" />

</beans>


出現mybatis-config.xml文件中出現
<!DOCTYPE configuration
    PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
    "http://mybatis.org/dtd/mybatis-3-config.dtd">

<configuration>



出現mybatis-config.xml文件中出現
mybatis 配置文件報錯:"Referenced file contains errors(file:/D:/config/mybatis-3-config.dtd
<!DOCTYPE configuration
    PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
    "http://mybatis.org/dtd/mybatis-3-config.dtd">

<configuration>


Eclipse Build Validating比較慢,去掉Validating
windows -> Preferences->輸入valida ->Validation
Build->只保留(Classpath Dependency Validation)這一項,其它Build中全部去掉,
->Manual不要改動保持原樣


語法檢查,拼寫錯誤
在此我去掉了語法檢查,爲了簡單(網上有做字典的)
windows -> Preferences->Spelling->Enable spell checking(我把這個選項去掉)

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章