maven中遇到的問題,報錯

 

maven中央倉庫地址pom.xml配置 java

<!-- 設定主倉庫,按設定順序進行查找。 -->
<repositories>

<!-- 若有Nexus私服, 取消註釋並指向正確的服務器地址.
<repository>
<id>nexus-repos</id>
<name>Team Nexus Repository</name>
<url>http://127.0.0.1:8888/nexus/content/groups/public</url>
</repository> -->

<repository>
            <id>oschina-repos</id>
            <name>Oschina Releases</name>
            <url>http://maven.oschina.net/content/groups/public</url>
        </repository>
        
        <repository>
            <id>java-repos</id>
            <name>Java Repository</name>
            <url>http://download.java.net/maven/2/</url>
        </repository>
        
        <repository>
            <id>springsource-repos</id>
            <name>SpringSource Repository</name>
            <url>http://repo.spring.io/release/</url>
        </repository>
        
<repository>
<id>central-repos</id>
<name>Central Repository</name>
<url>http://repo.maven.apache.org/maven2</url>
</repository>

<repository>
<id>central-repos2</id>
<name>Central Repository 2</name>
<url>http://repo1.maven.org/maven2/</url>
</repository>

<repository>
<id>activiti-repos</id>
<name>Activiti Repository</name>
<url>https://maven.alfresco.com/nexus/content/groups/public</url>
</repository>

<repository>
<id>activiti-repos2</id>
<name>Activiti Repository 2</name>
<url>https://app.camunda.com/nexus/content/groups/public</url>
</repository>

<repository> 
<id>thinkgem-repos</id> 
<name>ThinkGem Repository</name>
<url>http://git.oschina.net/thinkgem/repos/raw/master</url>
</repository>

<repository> 
<id>thinkgem-repos2</id> 
<name>ThinkGem Repository 2</name>
<url>https://raw.github.com/thinkgem/repository/master</url>
</repository>

</repositories>git

 

解決Failed to execute goal org.apache.maven.plugins

 

1.Maven構建失敗github

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin: 2.3 . 2 :compile ( default -compile) on project oecp: Compilation failure web

 

2.解決方法:spring

 

3.至少我是這麼幹的:使用本身的jdkapache

 

 

 

 

[ERROR] 錯誤: 讀取C:\Users\user\.m2\repository\org\springframework\spring-beans\4.0.9.RELEASE\spring-beans-4.0.9.RELEASE.jar時出錯; invalid LOC header (bad signature)

[ERROR] 錯誤: 讀取C:\Users\user\.m2\repository\org\springframework\spring-orm\4.0.9.RELEASE\spring-orm-4.0.9.RELEASE.jar時出錯; invalid LOC header (bad signature)json

[ERROR] 錯誤: 讀取C:\Users\user\.m2\repository\org\springframework\spring-jdbc\4.0.9.RELEASE\spring-jdbc-4.0.9.RELEASE.jar時出錯; invalid CEN header (bad signature)api

[ERROR] 錯誤: 讀取C:\Users\user\.m2\repository\org\aspectj\aspectjrt\1.7.4\aspectjrt-1.7.4.jar時出錯; invalid LOC header (bad signature)服務器

[ERROR] 錯誤: 讀取C:\Users\user\.m2\repository\org\aspectj\aspectjweaver\1.7.4\aspectjweaver-1.7.4.jar時出錯; invalid LOC header (bad signature)mybatis

[ERROR] 錯誤: 讀取C:\Users\user\.m2\repository\org\mybatis\mybatis\3.2.2\mybatis-3.2.2.jar時出錯; invalid LOC header (bad signature)

 

 

maven提示invalid LOC header (bad signature)的解決辦法

 

今天執行mvn test的時候提示:

錯誤:讀取 /home/subaochen/.m2/repository/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar 時出錯;invalid LOC header (bad signature)

解決的辦法是把提示的文件刪掉讓maven從新下載就解決了,或者刪除後,pom.xml指定版本爲之前存在的版原本使用

 

 

 

 

The method of type must override a superclass method解決方式

he method intercept(Invocation) of type PaginationInterceptor must override a superclass method

 

今天作struts2上傳文件的時候出現了這個問題:

 

The method execute() of type UploadAction must override or implement a supertype method


@Override 時出錯誤:


解決辦法是:

1、                                                                     
由於你的Compiler 是jdk1.5,只要把它改成 1.6

方法: 

1. window ->preferences... -> java -> Compiler

2. Compiler compliance level : 6.0

2、 把項目的JRE變成6.0的
項目右鍵->build path->configure build path->java Compiler(左邊那排中) ->在右邊的Compiler compliance level 修改版本爲6.0                                                                                                                                     

三。 而且檢查類名上是否繼承了ActionSupport  

 

org.springframework.http.converter.json.MappingJacksonHttpMessageConverter (in EnvironmentClassLoader[web-app:production/webapp/default/auto])

 

maven項目如何生成war文件

 

配置 你的pom.xml文件,在你的overview視窗裏 配置 packaging爲 war 而後
而後點擊 pom.xml右鍵,run  as 選擇 install 或是 package
若是項目沒問題,配置沒問題
就會在項目的target 的目錄裏生成 war文件

 

mvn install時報錯error;

 Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on project ik-analyzer: Compilation failure

解決方法:將項目導入eclipse中設置jdk後,在項目中install,不要在目錄中直接編譯

 

error:

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
Plugin

到.m2中刪除對應目錄c

相關文章
相關標籤/搜索