隨筆 - 23  文章 - 11  trackbacks - 0
          <2011年6月>
          2930311234
          567891011
          12131415161718
          19202122232425
          262728293012
          3456789

          常用鏈接

          留言簿(3)

          隨筆分類

          隨筆檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          1.編譯亂碼,設置編譯的字符集編碼和環境編碼
          <plugin>
                          <groupId>org.apache.maven.plugins</groupId>
                          <artifactId>maven-compiler-plugin</artifactId>
                          <version>2.3.2</version>
                          <configuration>
                              <source>1.4</source>
                              <target>1.4</target>
                              <encoding>UTF-8</encoding>
                          </configuration>
                      </plugin>
          設置環境變量MAVEN_OPTS=-Xms64m -Xmx128m -Dfile.encoding=UTF-8
          2.運行mvn test時亂碼(IDE上運行TestCase時OK,但是運行maven test亂碼,結果測試不通過)修改pom.xml增加如下內容即可
          <plugin>
                          <groupId>org.apache.maven.plugins</groupId>
                          <artifactId>maven-surefire-plugin</artifactId>
                          <version>2.7.2</version>
                          <configuration>
                              <forkMode>once</forkMode>
                              <argLine>-Dfile.encoding=UTF-8</argLine>
                              <systemProperties>
                                  <property>
                                      <name>net.sourceforge.cobertura.datafile</name>
                                      <value>target/cobertura/cobertura.ser</value>
                                  </property>
                              </systemProperties>
                          </configuration>
                      </plugin>
          posted on 2011-06-30 02:15 小小~咖啡豆 閱讀(1527) 評論(1)  編輯  收藏 所屬分類: 其他

          FeedBack:
          # re: mavn亂碼 2014-03-14 11:26 heiniu
          <forkMode>once</forkMode>
          <argLine>-Dfile.encoding=UTF-8</argLine>

          我加上這兩句,IDE提示這個元素不應該加在這里,問題也沒解決,請問要加在哪里呢?
          我用的IDEA12.0, maven 3.1.0  回復  更多評論
            
          主站蜘蛛池模板: 尚志市| 玉门市| 白城市| 东方市| 谢通门县| 册亨县| 石城县| 宁国市| 临夏县| 呼伦贝尔市| 沧州市| 龙口市| 井冈山市| 巴里| 通化县| 东乡县| 长垣县| 财经| 弥渡县| 红原县| 雷波县| 汨罗市| 台前县| 涡阳县| 松阳县| 东港市| 陈巴尔虎旗| 浦东新区| 海城市| 西乌珠穆沁旗| 星座| 沙坪坝区| 潞城市| 尼勒克县| 临清市| 西城区| 秦皇岛市| 台山市| 靖远县| 六安市| 绵竹市|