Java – how to speed up the build process using Maven tools

I use Maven as a build tool At present, I am doing the following construction

Right click on the project - >maven clean.

After that

Right click on the project - >maven install

I need three minutes. Is there any way to speed up my process

I've seen this But I don't understand that Can any one me

Thank you in advance

LF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[WARNING] 
[WARNING] Some problems were encountered while building the effective model for com.test.test:TEST:war:1.0.0-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: com.Metaparadigm:json-rpc:jar -> duplicate declaration of version 1.0 @ line 323,column 15
[WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:tomcat-maven-plugin is missing. @ line 39,column 12
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 25,column 12
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-war-plugin is missing. @ line 18,column 11
[WARNING] 'dependencies.dependency.exclusions.exclusion.groupId' for log4j:log4j:jar is missing. @ line 356,column 18
[WARNING] 'dependencies.dependency.exclusions.exclusion.artifactId' for log4j:log4j:jar is missing. @ line 356,column 18
[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] 
[WARNING] For this reason,future Maven versions might no longer support building such malformed projects.
[WARNING] 
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Test Web 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] Could not transfer Metadata com.Test.Test:Test:1.0.0-SNAPSHOT/maven-Metadata.xml from/to wso2-maven2-repository (scp://dist.wso2.org/home/httpd/dist.wso2.org/maven2/): No connector available to access repository wso2-maven2-repository (scp://dist.wso2.org/home/httpd/dist.wso2.org/maven2/) of type default using the available factories AsyncRepositoryConnectorFactory,WagonRepositoryConnectorFactory
[WARNING] Failure to transfer com.Test.Test:Test:1.0.0-SNAPSHOT/maven-Metadata.xml from scp://dist.wso2.org/home/httpd/dist.wso2.org/maven2/ was cached in the local repository,resolution will not be reattempted until the update interval of wso2-maven2-repository has elapsed or updates are forced. Original error: Could not transfer Metadata com.Test.Test:Test:1.0.0-SNAPSHOT/maven-Metadata.xml from/to wso2-maven2-repository (scp://dist.wso2.org/home/httpd/dist.wso2.org/maven2/): No connector available to access repository wso2-maven2-repository (scp://dist.wso2.org/home/httpd/dist.wso2.org/maven2/) of type default using the available factories AsyncRepositoryConnectorFactory,WagonRepositoryConnectorFactory
Downloading: http://escidoc1.escidoc.mpg.de:8888/archiva/repository/internal/commons-collections/commons-collections/maven-Metadata.xml
[WARNING] Could not transfer Metadata commons-collections:commons-collections/maven-Metadata.xml from/to wso2-maven2-repository (scp://dist.wso2.org/home/httpd/dist.wso2.org/maven2/): No connector available to access repository wso2-maven2-repository (scp://dist.wso2.org/home/httpd/dist.wso2.org/maven2/) of type default using the available factories AsyncRepositoryConnectorFactory,WagonRepositoryConnectorFactory
[WARNING] Could not transfer Metadata commons-collections:commons-collections/maven-Metadata.xml from/to jasperreports (http://escidoc1.escidoc.mpg.de:8888/archiva/repository/internal): connection timed out to http://escidoc1.escidoc.mpg.de:8888/archiva/repository/internal/commons-collections/commons-collections/maven-Metadata.xml
[WARNING] The Metadata C:\Documents and Settings\ITGRIDS\.m2\repository\commons-collections\commons-collections\maven-Metadata-jaspersoft.xml is invalid: entity reference name can not contain character =' (position: START_TAG seen ...www.sermonillustrationlibrary.org/blocked/nospiders?mod=8819&qlvc=... @467:198) 
Downloading: http://escidoc1.escidoc.mpg.de:8888/archiva/repository/internal/commons-digester/commons-digester/maven-Metadata.xml
[WARNING] Could not transfer Metadata commons-digester:commons-digester/maven-Metadata.xml from/to wso2-maven2-repository (scp://dist.wso2.org/home/httpd/dist.wso2.org/maven2/): No connector available to access repository wso2-maven2-repository (scp://dist.wso2.org/home/httpd/dist.wso2.org/maven2/) of type default using the available factories AsyncRepositoryConnectorFactory,WagonRepositoryConnectorFactory
[WARNING] Could not transfer Metadata commons-digester:commons-digester/maven-Metadata.xml from/to jasperreports (http://escidoc1.escidoc.mpg.de:8888/archiva/repository/internal): connection timed out to http://escidoc1.escidoc.mpg.de:8888/archiva/repository/internal/commons-digester/commons-digester/maven-Metadata.xml
[WARNING] The Metadata C:\Documents and Settings\ITGRIDS\.m2\repository\commons-digester\commons-digester\maven-Metadata-jaspersoft.xml is invalid: entity reference name can not contain character =' (position: START_TAG seen ...www.sermonillustrationlibrary.org/blocked/nospiders?mod=8819&qlvc=... @425:221) 
Downloading: http://escidoc1.escidoc.mpg.de:8888/archiva/repository/internal/commons-logging/commons-logging/maven-Metadata.xml
[WARNING] Could not transfer Metadata commons-logging:commons-logging/maven-Metadata.xml from/to wso2-maven2-repository (scp://dist.wso2.org/home/httpd/dist.wso2.org/maven2/): No connector available to access repository wso2-maven2-repository (scp://dist.wso2.org/home/httpd/dist.wso2.org/maven2/) of type default using the available factories AsyncRepositoryConnectorFactory,WagonRepositoryConnectorFactory
[WARNING] Could not transfer Metadata commons-logging:commons-logging/maven-Metadata.xml from/to jasperreports (http://escidoc1.escidoc.mpg.de:8888/archiva/repository/internal): connection timed out to http://escidoc1.escidoc.mpg.de:8888/archiva/repository/internal/commons-logging/commons-logging/maven-Metadata.xml
[WARNING] The Metadata C:\Documents and Settings\ITGRIDS\.m2\repository\commons-logging\commons-logging\maven-Metadata-jaspersoft.xml is invalid: entity reference name can not contain character =' (position: START_TAG seen ...www.sermonillustrationlibrary.org/blocked/nospiders?mod=8819&qlvc=... @446:198) 
Downloading: http://escidoc1.escidoc.mpg.de:8888/archiva/repository/internal/com/lowagie/itext/maven-Metadata.xml
[WARNING] Could not transfer Metadata com.lowagie:itext/maven-Metadata.xml from/to wso2-maven2-repository (scp://dist.wso2.org/home/httpd/dist.wso2.org/maven2/): No connector available to access repository wso2-maven2-repository (scp://dist.wso2.org/home/httpd/dist.wso2.org/maven2/) of type default using the available factories AsyncRepositoryConnectorFactory,WagonRepositoryConnectorFactory
[WARNING] Could not transfer Metadata com.lowagie:itext/maven-Metadata.xml from/to jasperreports (http://escidoc1.escidoc.mpg.de:8888/archiva/repository/internal): connection timed out to http://escidoc1.escidoc.mpg.de:8888/archiva/repository/internal/com/lowagie/itext/maven-Metadata.xml
[WARNING] The Metadata C:\Documents and Settings\ITGRIDS\.m2\repository\com\lowagie\itext\maven-Metadata-jaspersoft.xml is invalid: entity reference name can not contain character =' (position: START_TAG seen ...www.sermonillustrationlibrary.org/blocked/nospiders?mod=8819&qlvc=... @425:221) 
Downloading: http://escidoc1.escidoc.mpg.de:8888/archiva/repository/internal/jfree/jcommon/maven-Metadata.xml
[WARNING] Could not transfer Metadata jfree:jcommon/maven-Metadata.xml from/to wso2-maven2-repository (scp://dist.wso2.org/home/httpd/dist.wso2.org/maven2/): No connector available to access repository wso2-maven2-repository (scp://dist.wso2.org/home/httpd/dist.wso2.org/maven2/) of type default using the available factories AsyncRepositoryConnectorFactory,WagonRepositoryConnectorFactory
[WARNING] Could not transfer Metadata jfree:jcommon/maven-Metadata.xml from/to jasperreports (http://escidoc1.escidoc.mpg.de:8888/archiva/repository/internal): connection timed out to http://escidoc1.escidoc.mpg.de:8888/archiva/repository/internal/jfree/jcommon/maven-Metadata.xml
[WARNING] The Metadata C:\Documents and Settings\ITGRIDS\.m2\repository\jfree\jcommon\maven-Metadata-jaspersoft.xml is invalid: entity reference name can not contain character =' (position: START_TAG seen ...www.sermonillustrationlibrary.org/blocked/nospiders?mod=8819&qlvc=... @443:198) 
Downloading: http://escidoc1.escidoc.mpg.de:8888/archiva/repository/internal/jfree/jfreechart/maven-Metadata.xml
[WARNING] Could not transfer Metadata jfree:jfreechart/maven-Metadata.xml from/to wso2-maven2-repository (scp://dist.wso2.org/home/httpd/dist.wso2.org/maven2/): No connector available to access repository wso2-maven2-repository (scp://dist.wso2.org/home/httpd/dist.wso2.org/maven2/) of type default using the available factories AsyncRepositoryConnectorFactory,WagonRepositoryConnectorFactory
[WARNING] Could not transfer Metadata jfree:jfreechart/maven-Metadata.xml from/to jasperreports (http://escidoc1.escidoc.mpg.de:8888/archiva/repository/internal): connection timed out to http://escidoc1.escidoc.mpg.de:8888/archiva/repository/internal/jfree/jfreechart/maven-Metadata.xml
Downloading: http://escidoc1.escidoc.mpg.de:8888/archiva/repository/internal/eclipse/jdtcore/maven-Metadata.xml
[WARNING] Could not transfer Metadata eclipse:jdtcore/maven-Metadata.xml from/to wso2-maven2-repository (scp://dist.wso2.org/home/httpd/dist.wso2.org/maven2/): No connector available to access repository wso2-maven2-repository (scp://dist.wso2.org/home/httpd/dist.wso2.org/maven2/) of type default using the available factories AsyncRepositoryConnectorFactory,WagonRepositoryConnectorFactory
[WARNING] Could not transfer Metadata eclipse:jdtcore/maven-Metadata.xml from/to jasperreports (http://escidoc1.escidoc.mpg.de:8888/archiva/repository/internal): connection timed out to http://escidoc1.escidoc.mpg.de:8888/archiva/repository/internal/eclipse/jdtcore/maven-Metadata.xml
[WARNING] The Metadata C:\Documents and Settings\ITGRIDS\.m2\repository\eclipse\jdtcore\maven-Metadata-jaspersoft.xml is invalid: entity reference name can not contain character =' (position: START_TAG seen ...www.sermonillustrationlibrary.org/blocked/nospiders?mod=8819&qlvc=... @435:198) 
Downloading: http://escidoc1.escidoc.mpg.de:8888/archiva/repository/internal/javax/servlet/servlet-api/maven-Metadata.xml
[WARNING] Could not transfer Metadata javax.servlet:servlet-api/maven-Metadata.xml from/to wso2-maven2-repository (scp://dist.wso2.org/home/httpd/dist.wso2.org/maven2/): No connector available to access repository wso2-maven2-repository (scp://dist.wso2.org/home/httpd/dist.wso2.org/maven2/) of type default using the available factories AsyncRepositoryConnectorFactory,WagonRepositoryConnectorFactory
[WARNING] Could not transfer Metadata javax.servlet:servlet-api/maven-Metadata.xml from/to jasperreports (http://escidoc1.escidoc.mpg.de:8888/archiva/repository/internal): connection timed out to http://escidoc1.escidoc.mpg.de:8888/archiva/repository/internal/javax/servlet/servlet-api/maven-Metadata.xml
[WARNING] The artifact jstl:jstl:jar:1.1.2 has been relocated to javax.servlet:jstl:jar:1.1.2
[INFO] 
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ Test ---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,i.e. build is platform dependent!
[INFO] Copying 23 resources
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ Test ---
[WARNING] File encoding has not been set,using platform encoding Cp1252,i.e. build is platform dependent!
[INFO] Compiling 384 source files to D:\TEST\target\classes
[INFO] 
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ Test ---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ Test ---
[INFO] Nothing to compile - all classes are up to date

Solution

If you use multiple Maven modules in your project, this may apply to you: I mainly use Maven through the console, so I don't have any experience under the solar eclipse, but Maven supports parallel construction since Maven 3 This feature is out of the box, but its success depends on the plug-in you use, because third-party plug-ins may not be designed to work like this

To activate parallel builds, start Maven with the - t parameter:

mvn clean install -T 2

Build with 2 threads

mvn clean install -T 2C

Each CPU builds two threads

Maven will determine the build order and parallelize it as much as possible

Sadly, if your project module structure is very linear, i.e. project a – > project B – > project C, this will not be beneficial

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>