Pit run maven encountered almost collapsed.

Reference Links 1: https://blog.csdn.net/lch_cn/article/details/8225448/

Reference Links 2: https://jingyan.baidu.com/article/ad310e80ef28c81849f49e16.html

Abnormal 1:

[ERROR] Failed to execute goal on project biz_zhuhai: Could not resolve dependencies for project biz_zhuhai:biz_zhuhai:jar:0.0.1-SNAPSHOT: Failed to collect dependencies for [com.maywide.ibh:lib345:pom:1.0 (compile)]: Failed to read artifact descriptor for com.maywide.ibh:lib345:pom:1.0: Could not transfer artifact com.maywide.ibh:lib345:pom:1.0 from/to releases (http://localhost:9888/nexus-2.0.3/content/repositories/releases): Connection to http://localhost:9888 refused: Connection refused: connect -> [Help 1]

Solution:

This is the configuration of an error or url is no PW with a good result in an error when downloading components. If you do not need to download jar package in the PW, the PW can not configure, that is, you can put all deleted profiles setting.xml's something.

 

Abnormal 2:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.10:test (default-test) on project web_nanchang: There are test failures.

[ERROR]

[ERROR] Please refer to E:\maven\web_nanchang\target\surefire-reports for the individual test results.

Solution:

This is because the error was encountered while testing code, it will stop compiling. Only you need to add the following configuration in the pom.xml <project> years, so that the test error does not affect the compiled project.

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
                <testFailureIgnore>true</testFailureIgnore>
            </configuration>
        </plugin>
    </plugins>
</build>
 

Abnormal 3:

[ERROR] Failed to execute goal org.codehaus.cargo:cargo-maven2-plugin:1.0.6:start (start-container) on project myproject: Execution start-container of goal org.codehaus.cargo:cargo-maven2-plugin:1.0.6:start failed: Error while expanding C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\cargo\installs\apache-tomcat-6.0.29.zip
[ERROR] java.io.IOException: Negative seek offset
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutio
nException

Solution:

Download your own "apache-tomcat-6.0.29.zip", the downloaded files are copied to the specified folder: under "C \ Documents and Settings \ Administrator \ Local Settings \ Temp \ cargo \ installs".

 

Abnormal 4:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project web_nanchang: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions, please read the following articles:

Solution:

maven web project is in default webroot src \ main \ webapp. If you can not find this directory in web.xml throw more exceptions. Solution by adding the following configuration in pom.xml. Red font into the root directory of your site.

<build>
    <finalName>simple-webapp</finalName>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.1.1</version>
            <configuration>
                <webResources>
                    <resource>
                        <!-- this is relative to the pom.xml directory -->
                        <directory>WebContent</directory>
                    </resource>
                </webResources>
            </configuration>
        </plugin>
    </plugins>
</build>

Problems and Solutions Maven file download jar package appears at the end of .lastUpdated

Original link: https://blog.csdn.net/qq784515681/article/details/88739188

Error reason

The reason file appears at the end .lastUpdated: Because there is no reason for the network to download the full Maven dependencies cause.

solution:

There are circumstances under Sifu address:

1, delete all files ending in .lastUpdate

a) switching to the local repository maven

b) open cmd command line in the current directory

c) Windows执行命令:for /r %i in (*.lastUpdated) do del %i

d) Linux execute the command:

find /app/maven/localRepository -name "*.lastUpdated" -exec grep -q "Could not transfer" {} \; -print -exec rm {} \;

supplement:

IntelliJ IDEA how to re-download the deleted maven dependencies?

Right Project - "drop-down to find Maven -" to select Reimport.

The second jar package to solve the problem can not be loaded.


The first method: delete the local \ repository library all .lastupdate file extension and sha1-in-progress file with the extension, re-download
 when we use eclipse download jar package, something suddenly quit, or download the package again into the jar can not afford

     Possible reason is that when maven is not downloaded the jar, it will generate a file .lastupdate

     When the check code is not completed will generate sha1 sha1-in-progress file with the extension

     Workaround: Use file search tool (the landlord is Everything) input .lastupdate delete all files ending in .lastupdate;

      Enter sha1-in-progress delete all files sha1-in-progress at the end of.

Then simply modify .pom (such as spaces) Save, and then eclipse will re-download jar package!

  The second way: maven add a mirror address, edit maven root directory conf folder settings.xml
 

Mirrors the increase in

<mirrors>  

    <mirror>  
           <id>ibiblio.org</id>  
           <name>ibiblio Mirror of http://repo1.maven.org/maven2/</name>  
           <url>http://mirrors.ibiblio.org/pub/mirrors/maven2</url>  
           <mirrorOf>central</mirrorOf>  
           <!-- United States, North Carolina -->  
     </mirror>  
     <mirror>  
         <id>jboss-public-repository-group</id>  
         <mirrorOf>central</mirrorOf>  
         <name>JBoss Public Repository Group</name>  
         <url>http://repository.jboss.org/nexus/content/groups/public</url>  
     </mirror>  
  </mirrors></span>  
     After adding preservation, re-edit pom file, add a space or something, can download part of the jar package, there are some not download jar

  The third approach: copy respective jar, manually into the local library
 

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context-support</artifactId>
    <version>3.1.0.RELEASE</version>
</dependency>

Maven installation JAR package command is:
 

  mvn install: position -DgroupId install-file -Dfile = jar above packet = groupId -DartifactId = artifactId -Dversion = above upper version -Dpackaging = jar

How to manually obtain the jar package,

1, by querying the respective packet in http://mvnrepository.com/ jar, as the query Sqljdbc4

2 to obtain the following maven

<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/sqljdbc4 -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<version>4.0</version>
<scope>test</scope>
</dependency>

You can be entered by http://clojars.org/repo/ to the browser, and by groupId artifactId and the version number, the query to the jar package, and then downloaded to the local

 

Under linux

~ / .m2 -name "* .lastUpdated" -q -exec grep "Could Not Transfer" {} \; -print -exec RM {} \;
 
. CD% USERPROFILE% \ M2 \ Repository
for / I in R & lt% ( * .lastUpdated) do del% i
then right-click your project, Maven -> "Update project ... ", can be solved.
---------------------
Author: ckxuexixuexi
Source: CSDN
Original: https: //blog.csdn.net/ckxuexixuexi/article/details/80824203

Guess you like

Origin www.cnblogs.com/qcq0703/p/10964176.html