Maven build issue - Connection to repository refused - maven

I wish to import, change, rebuild, test and push/check-in my changes to the code available in this Github repository
Currently, I do not wish to use any IDE or plug-ins for this purpose.
I installed Maven on my Windows machine and as proceeded as per the installation instructions as shown below :
C:\Documents and Settings\298790\My Documents\Downloads\seismichadoop-master>mvn
-X package
Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 19:21:
28+0530)
Maven home: D:\Omkar\Development\Softwares\Tools\apache-maven-3.0.5
Java version: 1.6.0_20, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\Java\jdk1.6.0_20\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows xp", version: "5.1", arch: "x86", family: "windows"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from D:\Omkar\Development\Softwares\Tools\apache
-maven-3.0.5\conf\settings.xml
[DEBUG] Reading user settings from C:\Documents and Settings\298790\.m2\settings
.xml
[DEBUG] Using local repository at C:\Documents and Settings\298790\.m2\repositor
y
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for C:\Doc
uments and Settings\298790\.m2\repository
[INFO] Scanning for projects...
[DEBUG] Extension realms for project com.cloudera.seismic:seismic:jar:0.1.0: (no
ne)
[DEBUG] Looking up lifecyle mappings for packaging jar from ClassRealm[plexus.co
re, parent: null]
[DEBUG] === REACTOR BUILD PLAN ================================================
[DEBUG] Project: com.cloudera.seismic:seismic:jar:0.1.0
[DEBUG] Tasks: [package]
[DEBUG] Style: Regular
[DEBUG] =======================================================================
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building seismic 0.1.0
[INFO] ------------------------------------------------------------------------
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-so
urces, generate-resources, process-resources, compile, process-classes, generate
-test-sources, process-test-sources, generate-test-resources, process-test-resou
rces, test-compile, process-test-classes, test, prepare-package, package, pre-in
tegration-test, integration-test, post-integration-test, verify, install, deploy
]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] Using connector WagonRepositoryConnector with priority 0 for http://repo
.maven.apache.org/maven2
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-
resources-plugin/2.5/maven-resources-plugin-2.5.pom
[DEBUG] Writing resolution tracking file C:\Documents and Settings\298790\.m2\re
pository\org\apache\maven\plugins\maven-resources-plugin\2.5\maven-resources-plu
gin-2.5.pom.lastUpdated
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.573s
[INFO] Finished at: Fri May 24 12:05:55 IST 2013
[INFO] Final Memory: 2M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its
dependencies could not be resolved: Failed to read artifact descriptor for org.
apache.maven.plugins:maven-resources-plugin:jar:2.5: Could not transfer artifact
org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from/to central (http:/
/repo.maven.apache.org/maven2): Connection to http://repo.maven.apache.org refus
ed: Connection timed out: connect -> [Help 1]
org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugi
ns:maven-resources-plugin:2.5 or one of its dependencies could not be resolved:
Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-
plugin:jar:2.5
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.re
solve(DefaultPluginDependenciesResolver.java:129)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginD
escriptor(DefaultMavenPluginManager.java:142)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDes
criptor(DefaultMavenPluginManager.java:261)
at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(D
efaultBuildPluginManager.java:185)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalc
ulator.setupMojoExecution(DefaultLifecycleExecutionPlanCalculator.java:152)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalc
ulator.setupMojoExecutions(DefaultLifecycleExecutionPlanCalculator.java:139)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalc
ulator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:116)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalc
ulator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:129)
at org.apache.maven.lifecycle.internal.BuilderCommon.resolveBuildPlan(Bu
ilderCommon.java:92)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: org.sonatype.aether.resolution.ArtifactDescriptorException: Failed to
read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:ja
r:2.5
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.
loadPom(DefaultArtifactDescriptorReader.java:296)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.
readArtifactDescriptor(DefaultArtifactDescriptorReader.java:186)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.readArtifac
tDescriptor(DefaultRepositorySystem.java:279)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.re
solve(DefaultPluginDependenciesResolver.java:115)
... 25 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not
transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from/
to central (http://repo.maven.apache.org/maven2): Connection to http://repo.mave
n.apache.org refused
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(Def
aultArtifactResolver.java:538)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArti
facts(DefaultArtifactResolver.java:216)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArti
fact(DefaultArtifactResolver.java:193)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.
loadPom(DefaultArtifactDescriptorReader.java:281)
... 28 more
Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not tra
nsfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from/to c
entral (http://repo.maven.apache.org/maven2): Connection to http://repo.maven.ap
ache.org refused
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(W
agonRepositoryConnector.java:951)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(W
agonRepositoryConnector.java:941)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.
run(WagonRepositoryConnector.java:669)
at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(Run
nableErrorForwarder.java:60)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.apache.maven.wagon.TransferFailedException: Connection to http://
repo.maven.apache.org refused
at org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.fillInput
Data(AbstractHttpClientWagon.java:892)
at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:11
6)
at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.
run(WagonRepositoryConnector.java:601)
... 4 more
Caused by: org.apache.maven.wagon.providers.http.httpclient.conn.HttpHostConnect
Exception: Connection to http://repo.maven.apache.org refused
at org.apache.maven.wagon.providers.http.httpclient.impl.conn.DefaultCli
entConnectionOperator.openConnection(DefaultClientConnectionOperator.java:190)
at org.apache.maven.wagon.providers.http.httpclient.impl.conn.ManagedCli
entConnectionImpl.open(ManagedClientConnectionImpl.java:294)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultR
equestDirector.tryConnect(DefaultRequestDirector.java:645)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultR
equestDirector.execute(DefaultRequestDirector.java:480)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.Abstract
HttpClient.execute(AbstractHttpClient.java:906)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.Abstract
HttpClient.execute(AbstractHttpClient.java:805)
at org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.execute(A
bstractHttpClientWagon.java:746)
at org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.fillInput
Data(AbstractHttpClientWagon.java:886)
... 8 more
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at org.apache.maven.wagon.providers.http.httpclient.conn.scheme.PlainSoc
ketFactory.connectSocket(PlainSocketFactory.java:127)
at org.apache.maven.wagon.providers.http.httpclient.impl.conn.DefaultCli
entConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
... 15 more
[ERROR]
[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/PluginResoluti
onException
I tried to access the URL for which I'm getting the connection refused error :
http://repo.maven.apache.org
Browsing for this directory has been disabled.
View this directory's contents on http://search.maven.org instead.
The pom.xml is as follows :
<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>com.cloudera.seismic</groupId>
<artifactId>seismic</artifactId>
<version>0.1.0</version>
<packaging>jar</packaging>
<name>seismic</name>
<dependencies>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>
<version>1.0.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.crunch</groupId>
<artifactId>crunch</artifactId>
<version>0.4.0-incubating</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>maven-hadoop</id>
<name>Hadoop Releases</name>
<url>https://repository.cloudera.com/content/repositories/releases/</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/hadoop-job.xml</descriptor>
</descriptors>
<archive>
<manifest>
<mainClass>com.cloudera.seismic.segy.Main</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

Most probably you are behind proxy.
Try to do a telnet repo.maven.apache.org 80 and probably you will find it failed to connect.
In your settings.xml, add corresponding proxy settings to tell Maven to go through the proxy to download the artifacts
<settings>
.......
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>your_proxy_host</host>
<port>your_proxy_port</port>
<!--
<username>proxyuser</username>
<password>somepassword</password>
<nonProxyHosts>*.yourdomain.com|*.yourOtherDomain.com</nonProxyHosts>
-->
</proxy>
</proxies>
</settings>

Related

Not able to build using maven 3.6 and jdk 1.7

I have created a project using maven, but when I am building the project I am getting error.
I am using jdk 1.7u21
If I use jdk 1.8 it the build is working fine, its only I use jdk 1.7 then the issue is coming.
Tried using the TSL 1.2 in my build goal I have used
-Dhttps.protocols=TLSv1.2 clean install
Also I have tried adding the below :
wagon-ftp and plexus-utils
as under build
but still not working
my pom file is as mentioned below:
<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>com.collibra.aig.profitcenter</groupId>
<artifactId>ProfitCenterCodes</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>ProfitCenterCodes</name>
<description>ProfitCenterCodes</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<log4j.version>2.3</log4j.version>
<lombok.version>1.18.6</lombok.version>
<apache.httpclient.version>4.5.3</apache.httpclient.version>
<jackson.version>1.9.4</jackson.version>
<spring.core.version>5.1.6.RELEASE</spring.core.version>
<spring.context.version>5.1.6.RELEASE</spring.context.version>
<jacksondatabind.version>2.9.9</jacksondatabind.version>
<slf4j.version>1.7.12</slf4j.version>
<spring.web>5.1.7.RELEASE</spring.web>
</properties>
<dependencies>
<!-- Log4j API and Core implementation required for binding -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>${log4j.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>${log4j.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${apache.httpclient.version}</version>
<optional>true</optional>
</dependency>
<!-- Jackson dependencies -->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>${jackson.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jacksondatabind.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.context.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-core -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.core.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-web -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.web}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
<!-- https://mvnrepository.com/artifact/org.json/json -->
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180813</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>**/*.properties</exclude>
<exclude>**/log4j2.xml</exclude>
</excludes>
<filtering>false</filtering>
</resource>
</resources>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<excludes>
<exclude>**/*.properties</exclude>
</excludes>
<archive>
<manifest>
<mainClass>com.test.MainClass</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
The error I am getting is
[INFO] ----------< com.collibra.aig.profitcenter:ProfitCenterCodes >-----------
[INFO] Building ProfitCenterCodes 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] java.util.NoSuchElementException
role: org.apache.maven.wagon.Wagon
roleHint: https
org.codehaus.plexus.component.repository.exception.ComponentLookupException: java.util.NoSuchElementException
role: org.apache.maven.wagon.Wagon
roleHint: https
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:267)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:255)
at org.eclipse.aether.internal.transport.wagon.PlexusWagonProvider.lookup(PlexusWagonProvider.java:65)
at org.eclipse.aether.transport.wagon.WagonTransporter.lookupWagon(WagonTransporter.java:279)
at org.eclipse.aether.transport.wagon.WagonTransporter.<init>(WagonTransporter.java:123)
at org.eclipse.aether.transport.wagon.WagonTransporterFactory.newInstance(WagonTransporterFactory.java:136)
at org.eclipse.aether.internal.impl.DefaultTransporterProvider.newTransporter(DefaultTransporterProvider.java:113)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector.<init>(BasicRepositoryConnector.java:125)
at org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory.newInstance(BasicRepositoryConnectorFactory.java:175)
at org.eclipse.aether.internal.impl.DefaultRepositoryConnectorProvider.newRepositoryConnector(DefaultRepositoryConnectorProvider.java:116)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:494)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:399)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:224)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:201)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:261)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:192)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:253)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:103)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:181)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:286)
at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:244)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecution(DefaultLifecycleExecutionPlanCalculator.java:168)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecutions(DefaultLifecycleExecutionPlanCalculator.java:154)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:130)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:144)
at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan(BuilderCommon.java:96)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:110)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.util.NoSuchElementException
at org.eclipse.sisu.plexus.RealmFilteredBeans$FilteredItr.next(RealmFilteredBeans.java:118)
at org.eclipse.sisu.plexus.RealmFilteredBeans$FilteredItr.next(RealmFilteredBeans.java:1)
at org.eclipse.sisu.plexus.DefaultPlexusBeans$Itr.next(DefaultPlexusBeans.java:76)
at org.eclipse.sisu.plexus.DefaultPlexusBeans$Itr.next(DefaultPlexusBeans.java:1)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)
... 43 more
[DEBUG] Writing tracking file \\pngssvmh02\avkhan\.m2\repository\org\apache\maven\plugins\maven-clean-plugin\2.5\maven-clean-plugin-2.5.pom.lastUpdated
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.728 s
[INFO] Finished at: 2019-06-26T19:33:07+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Cannot access https://repo.maven.apache.org/maven2 with type default using the available connector factories: BasicRepositoryConnectorFactory: Cannot access https://repo.maven.apache.org/maven2 using the registered transporter factories: WagonTransporterFactory: java.util.NoSuchElementException
[ERROR] role: org.apache.maven.wagon.Wagon
[ERROR] roleHint: https
[ERROR] -> [Help 1]
org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:117)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:181)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:286)
at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:244)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecution(DefaultLifecycleExecutionPlanCalculator.java:168)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecutions(DefaultLifecycleExecutionPlanCalculator.java:154)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:130)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:144)
at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan(BuilderCommon.java:96)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:110)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:276)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:192)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:253)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:103)
... 26 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Cannot access https://repo.maven.apache.org/maven2 with type default using the available connector factories: BasicRepositoryConnectorFactory
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:422)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:224)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:201)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:261)
... 29 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (https://repo.maven.apache.org/maven2): Cannot access https://repo.maven.apache.org/maven2 with type default using the available connector factories: BasicRepositoryConnectorFactory
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:509)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:399)
... 32 more
Caused by: org.eclipse.aether.transfer.NoRepositoryConnectorException: Cannot access https://repo.maven.apache.org/maven2 with type default using the available connector factories: BasicRepositoryConnectorFactory
at org.eclipse.aether.internal.impl.DefaultRepositoryConnectorProvider.newRepositoryConnector(DefaultRepositoryConnectorProvider.java:177)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:494)
... 33 more
Caused by: org.eclipse.aether.transfer.NoRepositoryConnectorException: Cannot access https://repo.maven.apache.org/maven2 using the registered transporter factories: WagonTransporterFactory
at org.eclipse.aether.connector.basic.BasicRepositoryConnector.<init>(BasicRepositoryConnector.java:129)
at org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory.newInstance(BasicRepositoryConnectorFactory.java:175)
at org.eclipse.aether.internal.impl.DefaultRepositoryConnectorProvider.newRepositoryConnector(DefaultRepositoryConnectorProvider.java:116)
... 34 more
Caused by: org.eclipse.aether.transfer.NoTransporterException: Cannot access https://repo.maven.apache.org/maven2 using the registered transporter factories: WagonTransporterFactory
at org.eclipse.aether.internal.impl.DefaultTransporterProvider.newTransporter(DefaultTransporterProvider.java:154)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector.<init>(BasicRepositoryConnector.java:125)
... 36 more
Caused by: org.eclipse.aether.transfer.NoTransporterException: java.util.NoSuchElementException
role: org.apache.maven.wagon.Wagon
roleHint: https
at org.eclipse.aether.transport.wagon.WagonTransporter.<init>(WagonTransporter.java:128)
at org.eclipse.aether.transport.wagon.WagonTransporterFactory.newInstance(WagonTransporterFactory.java:136)
at org.eclipse.aether.internal.impl.DefaultTransporterProvider.newTransporter(DefaultTransporterProvider.java:113)
... 37 more
Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: java.util.NoSuchElementException
role: org.apache.maven.wagon.Wagon
roleHint: https
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:267)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:255)
at org.eclipse.aether.internal.transport.wagon.PlexusWagonProvider.lookup(PlexusWagonProvider.java:65)
at org.eclipse.aether.transport.wagon.WagonTransporter.lookupWagon(WagonTransporter.java:279)
at org.eclipse.aether.transport.wagon.WagonTransporter.<init>(WagonTransporter.java:123)
... 39 more
Caused by: java.util.NoSuchElementException
at org.eclipse.sisu.plexus.RealmFilteredBeans$FilteredItr.next(RealmFilteredBeans.java:118)
at org.eclipse.sisu.plexus.RealmFilteredBeans$FilteredItr.next(RealmFilteredBeans.java:1)
at org.eclipse.sisu.plexus.DefaultPlexusBeans$Itr.next(DefaultPlexusBeans.java:76)
at org.eclipse.sisu.plexus.DefaultPlexusBeans$Itr.next(DefaultPlexusBeans.java:1)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)
... 43 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
First check if the java -version is pointing to jdk 1.7, if it is showing as 1.7 then open a command prompt and go to the project folder.
from the folder run the below command
mvn -Dhttps.protocols=TLSv1.2 clean install
You will see that maven is downloading the dependencies, after downloading it will build your project and should result in success.
once its done then you can run the program from eclipse or any other IDE as usual.

How to Upload p2 repository to an http server using wagon-maven-plugin?

I am trying to upload my p2 eclipse repository to a http server by using wagon-maven-plugin.I configured my settings.xml like the following.
<server>
<id>p2Repo</id>
<username>xxx</username>
<password>xxx</password>
<configuration>
<wagonProvider>httpclient</wagonProvider>
</configuration>
</server>
And the eclipse-repository project pom.xml is as follows:
<distributionManagement>
<repository>
<id>p2Repo</id>
<url>http://192.168.15.20:9001</url>
</repository>
</distributionManagement>
<properties>
<!-- Relative path to the repo being uploaded -->
<repo.path>${basedir}/target/repository/</repo.path>
</properties>
<extensions>
<!-- Enabling the use of HTTP -->
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http</artifactId>
<version>1.0-beta-7</version>
</extension>
</extensions>
<build>
<plugins>
<!-- Upload the repo to the server -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>wagon-maven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<id>upload-repo</id>
<phase>install</phase>
<goals>
<goal>upload</goal>
</goals>
<configuration>
<fromDir>${repo.path}</fromDir>
<includes>*/**</includes>
<toDir>dependency</toDir>
<url>http://192.168.15.20:9001</url>
<serverId>p2Repo</serverId>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
During the maven build i am getting error like the following
[INFO] Uploading C:\Users\obulis\git\dependency- bundles\target\repository\artifacts.jar to http://192.168.15.20:9001/dependency/artifacts.jar ...
Uploading: dependency/artifacts.jar to http://192.168.15.20:9001
#http://192.168.15.20:9001/dependency/artifacts.jar - Status code: 405
Transfer error: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: http://192.168.15.20:9001/dependency/artifacts.jar. Return code is: 405
http://192.168.15.20:9001 - Session: Disconnecting
http://192.168.15.20:9001 - Session: Disconnected
[INFO] ------------------------------------------------------------------- -----
[INFO] BUILD FAILURE
[INFO] ----------------------------------------------------------------- -------
[INFO] Total time: 1:07.706s
[INFO] Finished at: Sun Jul 19 19:36:49 IST 2015
[INFO] Final Memory: 11M/27M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:wagon-maven- plugin:1.0:upload (upload-repo) on project dependency-bundles: Error handling resource: Failed to transfer file: http://192.168.15.20:9001/dependency/artifacts.jar. Return code is: 405 -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:wagon-maven-plugin:1.0:upload (upload-repo) on project aqua-dependency-bundles: Error handling resource
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error handling resource
at org.codehaus.mojo.wagon.AbstractSingleWagonMojo.execute(AbstractSingleWagonMojo.java:68)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: http://192.168.15.20:9001/dependency/artifacts.jar. Return code is: 405
at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:368)
at org.apache.maven.wagon.shared.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:280)
at org.codehaus.mojo.wagon.shared.DefaultWagonUpload.upload(DefaultWagonUpload.java:79)
at org.codehaus.mojo.wagon.shared.DefaultWagonUpload.upload(DefaultWagonUpload.java:89)
at org.codehaus.mojo.wagon.UploadMojo.execute(UploadMojo.java:120)
at org.codehaus.mojo.wagon.AbstractSingleWagonMojo.execute(AbstractSingleWagonMojo.java:64)
... 21 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Any advice ?
Thanks in Advance.

Deploying a Maven Project in Tomcat

I have a problem when I wan't to deploy my maven project with tomcat. I only get a 404.
When I try it with jetty it works fine.
I think there is something wrong with the pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<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>
<groupId>com.shoot.tail</groupId>
<artifactId>shootout</artifactId>
<packaging>war</packaging>
<version>1.2</version>
<name>Shootout</name>
<repositories>
<repository>
<id>java.net</id>
<url>https://maven.java.net/content/repositories/releases</url>
</repository>
</repositories>
<properties>
<myfaces.version>2.1.8</myfaces.version>
<mojarra.version>2.1.11</mojarra.version>
<jetty.version>8.1.5.v20120716</jetty.version>
<tomcat.version>7.0.12</tomcat.version>
</properties>
<profiles>
<profile>
<id>mojarra</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>${mojarra.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>${mojarra.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>jdbc-pool</artifactId>
<version>${jdbc-pool.version}</version>
<scope>system</scope>
<systemPath>${basedir}/../${web.project}/WebContent/WEB-INF/lib/tomcat-jdbc.jar</systemPath>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>juli</artifactId>
<version>${tomcat.version}</version>
</dependency>
</dependencies>
<properties>
<override-web-xml>src/main/jetty/override-mojarra-web.xml</override-web-xml>
</properties>
</profile>
<profile>
<id>myfaces</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
<version>${myfaces.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-impl</artifactId>
<version>${myfaces.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
<properties>
<override-web-xml>src/main/jetty/override-myfaces-web.xml</override-web-xml>
</properties>
</profile>
</profiles>
<!-- Project dependencies -->
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-servlet_3.0_spec</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<finalName>shootout</finalName>
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>${tomcat.version}</version>
<configuration>
<webAppConfig>
<contextPath>/${project.artifactId}</contextPath>
<overrideDescriptor>${override-web-xml}</overrideDescriptor>
</webAppConfig>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.version}</version>
<configuration>
<webAppConfig>
<contextPath>/${project.artifactId}</contextPath>
<overrideDescriptor>${override-web-xml}</overrideDescriptor>
</webAppConfig>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<wtpversion>2.0</wtpversion>
<downloadSources>true</downloadSources>
<additionalProjectFacets>
<jst.jsf>2.0</jst.jsf>
</additionalProjectFacets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
Version
Eclipse: Juno
Tomcat: 7.0.12
Maven: 3.0.5
And the error:
[ERROR] Plugin org.codehaus.mojo:tomcat-maven-plugin:7.0.12 or one of its depend
encies could not be resolved: Failed to read artifact descriptor for org.codehau
s.mojo:tomcat-maven-plugin:jar:7.0.12: Failure to find org.codehaus.mojo:tomcat-
maven-plugin:pom:7.0.12 in http://repo.maven.apache.org/maven2 was cached in the
local repository, resolution will not be reattempted until the update interval
of central has elapsed or updates are forced -> [Help 1]
org.apache.maven.plugin.PluginResolutionException: Plugin org.codehaus.mojo:tomc
at-maven-plugin:7.0.12 or one of its dependencies could not be resolved: Failed
to read artifact descriptor for org.codehaus.mojo:tomcat-maven-plugin:jar:7.0.12
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.re
solve(DefaultPluginDependenciesResolver.java:129)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginD
escriptor(DefaultMavenPluginManager.java:142)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDes
criptor(DefaultMavenPluginManager.java:261)
at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(D
efaultBuildPluginManager.java:185)
at org.apache.maven.lifecycle.internal.MojoDescriptorCreator.getMojoDesc
riptor(MojoDescriptorCreator.java:235)
at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalcul
ator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:106)
at org.apache.maven.lifecycle.internal.DefaultLifecycleTaskSegmentCalcul
ator.calculateTaskSegments(DefaultLifecycleTaskSegmentCalculator.java:86)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:98)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: org.sonatype.aether.resolution.ArtifactDescriptorException: Failed to
read artifact descriptor for org.codehaus.mojo:tomcat-maven-plugin:jar:7.0.12
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.
loadPom(DefaultArtifactDescriptorReader.java:296)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.
readArtifactDescriptor(DefaultArtifactDescriptorReader.java:186)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.readArtifac
tDescriptor(DefaultRepositorySystem.java:279)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.re
solve(DefaultPluginDependenciesResolver.java:115)
... 20 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Failure t
o find org.codehaus.mojo:tomcat-maven-plugin:pom:7.0.12 in http://repo.maven.apa
che.org/maven2 was cached in the local repository, resolution will not be reatte
mpted until the update interval of central has elapsed or updates are forced
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(Def
aultArtifactResolver.java:538)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArti
facts(DefaultArtifactResolver.java:216)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArti
fact(DefaultArtifactResolver.java:193)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.
loadPom(DefaultArtifactDescriptorReader.java:281)
... 23 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Failure to fi
nd org.codehaus.mojo:tomcat-maven-plugin:pom:7.0.12 in http://repo.maven.apache.
org/maven2 was cached in the local repository, resolution will not be reattempte
d until the update interval of central has elapsed or updates are forced
at org.sonatype.aether.impl.internal.DefaultUpdateCheckManager.newExcept
ion(DefaultUpdateCheckManager.java:230)
at org.sonatype.aether.impl.internal.DefaultUpdateCheckManager.checkArti
fact(DefaultUpdateCheckManager.java:204)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(Def
aultArtifactResolver.java:427)
... 26 more
[ERROR]
[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/PluginResoluti
onException
Thanks a lot for your help.
Best wishes
Robert
Solved.
this is my final pom.xml:
[...]
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<server>tomcat</server>
<url>http://localhost:8080/manager/text</url>
</configuration>
</plugin>
[...]
Thanks guido for your help (:
this works:
https://stackoverflow.com/a/16592276/503601
there is a bug in the plugin. This plugin doesn`t read the tag url.
<configuration>
<url>http://localhost:8080/manager/html</url>
</configuration>
to set property use
<properties>
<maven.tomcat.url>http://localhost:8080/manager/text</maven.tomcat.url>
</properties>
full article in http://jvm-java.blogspot.com.es/2013/06/publish-with-maven-in-tomcat7.html
You are specifying tomcat version instead of the tomcat-maven-plugin version, causing maven to not finding the plugin (actually reading the error message should have helped you); here:
<properties>
<tomcat.version>7.0.12</tomcat.version>
</properties>
[...]
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>${tomcat.version}</version>
[...]
Use 1.2-SNAPSHOT (for instance) for ${tomcat.version} or declare another variable if using tomcat version elsewhere.
Plus, tomcat 7.0 needs additional configuration for interacting to the manager webapp, like this:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<version>1.2-SNAPSHOT</version>
<configuration>
<url>http://localhost:8080/manager/html</url>
</configuration>
</plugin>
OR, you can use version 2.x which has been moved under apache, and where mojos have been renamed to tomcat6 and tomcat7 with the same goals.
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat6-maven-plugin</artifactId>
<version>2.1</version>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
</plugin>
</plugins>
</pluginManagement>
yeah that looks better.
I think it try to deploy the project, but get a build failure.
[INFO] Error stacktraces are turned on.
[WARNING]
[WARNING] Some problems were encountered while building the effective settings
[WARNING] Unrecognised tag: 'id' (position: START_TAG seen ...<servers>\n \t<id
>... #112:8) # C:\Software\maven\conf\settings.xml, line 112, column 8
[WARNING]
[INFO] Scanning for projects...
[WARNING] The POM for org.codehaus.mojo:tomcat7-maven-plugin:jar:2.0-SNAPSHOT is
missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.codehaus.mojo:tomcat7-mav
en-plugin:2.0-SNAPSHOT: Plugin org.codehaus.mojo:tomcat7-maven-plugin:2.0-SNAPSH
OT or one of its dependencies could not be resolved: Failed to read artifact des
criptor for org.codehaus.mojo:tomcat7-maven-plugin:jar:2.0-SNAPSHOT
Downloading: http://repository.apache.org/content/groups/snapshots-group/org/apa
che/maven/plugins/maven-metadata.xml
[WARNING] Could not transfer metadata org.apache.maven.plugins/maven-metadata.xm
l from/to apache.snapshots (http://repository.apache.org/content/groups/snapshot
s-group/): Failed to transfer file: http://repository.apache.org/content/groups/
snapshots-group/org/apache/maven/plugins/maven-metadata.xml. Return code is: 500
, ReasonPhrase:Server Error.
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Shootout 1.2
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.codehaus.mojo:tomcat7-maven-plugin:jar:2.0-SNAPSHOT is
missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.codehaus.mojo:tomcat7-mav
en-plugin:2.0-SNAPSHOT: Plugin org.codehaus.mojo:tomcat7-maven-plugin:2.0-SNAPSH
OT or one of its dependencies could not be resolved: Failed to read artifact des
criptor for org.codehaus.mojo:tomcat7-maven-plugin:jar:2.0-SNAPSHOT
[WARNING] Failure to transfer org.apache.maven.plugins/maven-metadata.xml from h
ttp://repository.apache.org/content/groups/snapshots-group/ was cached in the lo
cal repository, resolution will not be reattempted until the update interval of
apache.snapshots has elapsed or updates are forced. Original error: Could not tr
ansfer metadata org.apache.maven.plugins/maven-metadata.xml from/to apache.snaps
hots (http://repository.apache.org/content/groups/snapshots-group/): Failed to t
ransfer file: http://repository.apache.org/content/groups/snapshots-group/org/ap
ache/maven/plugins/maven-metadata.xml. Return code is: 500 , ReasonPhrase:Server
Error.
[INFO]
[INFO] >>> tomcat-maven-plugin:1.1:deploy (default-cli) # shootout >>>
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) # shootout -
--
[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:compile (default-compile) # shootout ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) # sh
ootout ---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) # shoot
out ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.10:test (default-test) # shootout ---
[INFO] Surefire report directory: C:\Software\workspace\shootout\target\suref
ire-reports
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO] --- maven-war-plugin:2.1.1:war (default-war) # shootout ---
[INFO] Packaging webapp
[INFO] Assembling webapp [shootout] in [C:\Software\workspace\shootout\target
\shootout]
[INFO] Processing war project
[INFO] Copying webapp resources [C:\Software\workspace\shootout\src\main\weba
pp]
[INFO] Webapp assembled in [47 msecs]
[INFO] Building war: C:\Software\workspace\shootout\target\shootout.war
[WARNING] Warning: selected war files include a WEB-INF/web.xml which will be ig
nored
(webxml attribute is missing from war task, or ignoreWebxml attribute is specifi
ed as 'true')
[INFO]
[INFO] <<< tomcat-maven-plugin:1.1:deploy (default-cli) # shootout <<<
[INFO]
[INFO] --- tomcat-maven-plugin:1.1:deploy (default-cli) # shootout ---
[INFO] Deploying war to http://localhost:8080/shootout
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.682s
[INFO] Finished at: Fri Mar 15 10:21:19 CET 2013
[INFO] Final Memory: 10M/24M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:deploy
(default-cli) on project shootout: Cannot invoke Tomcat manager: Connection refu
sed: connect -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
rg.codehaus.mojo:tomcat-maven-plugin:1.1:deploy (default-cli) on project shootou
t: Cannot invoke Tomcat manager
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot invoke Tomcat
manager
at org.codehaus.mojo.tomcat.AbstractCatalinaMojo.execute(AbstractCatalin
aMojo.java:149)
at org.codehaus.mojo.tomcat.AbstractWarCatalinaMojo.execute(AbstractWarC
atalinaMojo.java:70)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default
BuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:209)
... 19 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketI
mpl.java:69)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.ja
va:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocket
Impl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java
:182)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:378)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:473)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:203)
at sun.net.www.http.HttpClient.New(HttpClient.java:290)
at sun.net.www.http.HttpClient.New(HttpClient.java:306)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLC
onnection.java:995)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConne
ction.java:931)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection
.java:849)
at org.codehaus.mojo.tomcat.TomcatManager.invoke(TomcatManager.java:597)
at org.codehaus.mojo.tomcat.TomcatManager.deployImpl(TomcatManager.java:
662)
at org.codehaus.mojo.tomcat.TomcatManager.deploy(TomcatManager.java:295)
at org.codehaus.mojo.tomcat.AbstractDeployWarMojo.deployWar(AbstractDepl
oyWarMojo.java:85)
at org.codehaus.mojo.tomcat.AbstractDeployMojo.invokeManager(AbstractDep
loyMojo.java:85)
at org.codehaus.mojo.tomcat.AbstractCatalinaMojo.execute(AbstractCatalin
aMojo.java:141)
... 22 more
[ERROR]
[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/MojoExecutionE
xception
C:\Software\maven\conf\settings.xml: Line 111-115
<servers>
<id>tomcat</id>
<username>admin</username>
<password>admin</password>
</servers>
pom.xml
<repositories>
[...]
<repository>
<id>people.apache.snapshots</id>
<url>http://repository.apache.org/content/groups/snapshots-group/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
[...]
<pluginRepositories>
<pluginRepository>
<id>apache.snapshots</id>
<name>Apache Snapshots</name>
<url>http://repository.apache.org/content/groups/snapshots-group/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
[...]
<build>
<finalName>shootout</finalName>
<defaultGoal>install</defaultGoal>
<plugins>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.version}</version>
<configuration>
<webAppConfig>
<contextPath>/${project.artifactId}</contextPath>
<overrideDescriptor>${override-web-xml}</overrideDescriptor>
</webAppConfig>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
<configuration>
<url>http://localhost:8080/manager/html</url>
<server>tomcat</server>
<username>admin</username>
<password>admin</password>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<wtpversion>2.0</wtpversion>
<downloadSources>true</downloadSources>
<additionalProjectFacets>
<jst.jsf>2.0</jst.jsf>
</additionalProjectFacets>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
thanks for your help and sorry about the amount of questions.
robert

Failed to parse plugin descriptor for org.apache.maven.plugins:maven-resources-plugin:2.4.3.. error in opening zip file

I was using maven to build and compile a spring project and here's what I got an error about "error in opening zip file.". I attached the settings.xml here to show that I configured the proxy right and the pom.xml.
[SETTINGS.XML]
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>XXXX</host>
<port>8080</port>
<username>XXXX</username>
<password>XXXXX</password>
<nonProxyHosts>localhost</nonProxyHosts>
</proxy>
[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>
<groupId>com.wrox</groupId>
<artifactId>springfirst</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>springfirst</name>
<url>http://maven.apache.org</url>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
<testSourceDirectory>src/test/java</testSourceDirectory>
<resources>
<resource>
<directory>src/main/java</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/java</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
<filtering>true</filtering>
</testResource>
<testResource>
<directory>src/test/resources</directory>
</testResource>
</testResources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<spring-version>2.0.6</spring-version>
<junit-version>3.8.2</junit-version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>${spring-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>${spring-version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit-version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
[ERROR MESSAGE]
E:\DOCUMENTS\ETC\TUTORIALS\begspringcode_091809\src\chapter1\springfirst>mvn -X compile
Apache Maven 3.0.3 (r1075438; 2011-03-01 01:31:09+0800)
Maven home: C:\maven2.2.1\bin\..
Java version: 1.6.0_15, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\Java\jdk1.6.0_15\jre
Default locale: en_PH, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "x86", family: "windows"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from C:\maven2.2.1\bin\..\conf\settings.xml
[DEBUG] Reading user settings from C:\Users\AMT\.m2\settings.xml
[DEBUG] Using local repository at C:\Users\AMT\.m2\repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for C:\Users\AMT\.m2\repository
[INFO] Scanning for projects...
[DEBUG] Extension realms for project com.wrox:springfirst:jar:1.0-SNAPSHOT: (none)
[DEBUG] Looking up lifecyle mappings for packaging jar from ClassRealm[plexus.core, parent: null]
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.wrox:springfirst:jar:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. # line 42, column 12
[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]
[DEBUG] === REACTOR BUILD PLAN ================================================
[DEBUG] Project: com.wrox:springfirst:jar:1.0-SNAPSHOT
[DEBUG] Tasks: [compile]
[DEBUG] Style: Regular
[DEBUG] =======================================================================
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building springfirst 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-pack
age, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.177s
[INFO] Finished at: Mon Oct 03 14:57:47 SGT 2011
[INFO] Final Memory: 1M/4M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to parse plugin descriptor for org.apache.maven.plugins:maven-resources-plugin:2.4.3 (C:\Users\AMT\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\2.4.3\maven-resources-plugin-2.4.3.jar): error in opening zip file -> [Help 1]
org.apache.maven.plugin.PluginDescriptorParsingException: Failed to parse plugin descriptor for org.apache.maven.plugins:maven-resources-plugin:2.4.3 (C:\Users\AMT\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\2.4.3\maven-resources-plugin-2.4.3.jar): error in opening zip file
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.extractPluginDescriptor(DefaultMavenPluginManager.java:212)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:147)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:261)
at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:185)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecution(DefaultLifecycleExecutionPlanCalculator.java:152)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecutions(DefaultLifecycleExecutionPlanCalculator.java:139)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:116)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:129)
at org.apache.maven.lifecycle.internal.BuilderCommon.resolveBuildPlan(BuilderCommon.java:92)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:114)
at java.util.jar.JarFile.<init>(JarFile.java:133)
at java.util.jar.JarFile.<init>(JarFile.java:112)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.extractPluginDescriptor(DefaultMavenPluginManager.java:170)
... 25 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginDescriptorParsingException
'cmd' is not recognized as an internal or external command,
operable program or batch file.
E:\DOCUMENTS\ETC\TUTORIALS\begspringcode_091809\src\chapter1\springfirst>
Delete C:\Users\AMT\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\2.4.3\maven-resources-plugin-2.4.3.jar or better still C:\Users\AMT\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\2.4.3\ folder and try again.
Evidently, the jar file is incomplete or corrupted.
Deleting the repository folder solved the issue.
Got the same issue. This worked for me.
Check your maven version
HOME>> mvn -version
3.0.3
I updated this to maven 3.2.1 and change the path in bash_profile. Now check it again.
HOME>> mvn -version
If it is updated, delete the repository and close the terminal. Reopen the terminal and type
Project Path >> mvn clean install
If it not updated, then type following
HOME>> echo $JAVA_HOME
HOME>> which java
/usr/share/java(for e.g.)
HOME>> cd /usr/share/java
HOME>> open .
You will see maven old version contents in it. Replace the contents of this with new version contents.
Then delete the repository.
Project Path>> mvn clean install
Now all your maven jars will be downloaded.
Hope this will help you.

maven scm:checkin error

My maven script generates a laconic "error 1", and I am a bit at a loss as to how to extract the root cause from the huge output.
Could you help me in isolating said root cause for this error?
Here is the command I used:
mvn scm:checkin -Dmessage="check in"
error 1.
List item [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-scm-plugin:1.5:checkin' with basic configurator --> [DEBUG] (f)
basedir = E:\workspace\mtest [DEBUG] (f)
connectionType = developerConnection [DEBUG] (s)
connectionUrl = scm:svn:https://192.168.10.44/svn/FTMobileAdNetwork/trunk/personal/xuhuiw/mvntest/mtest/
[DEBUG] (f) developerConnectionUrl = scm:svn:https://192.168.10.44/svn/FTMobileAdNetwork/trunk/personal/xuhuiw/mvntest/mtest/
[DEBUG] (s) includes = src/*,pom.xml
[DEBUG] (f) message = check in my mtest [DEBUG] (f) password = wangxuhui [DEBUG] (f) pushChanges = true
[DEBUG] (f) settings = org.apache.maven.execution.SettingsAdapter#2d0479
[DEBUG] (f) username = xuhuiw
[DEBUG] (s) workingDirectory = E:\workspace\mtest [DEBUG] -- end configuration --
[INFO] Executing: cmd.exe /X /C "svn --username xuhuiw --password ***** --no-auth-cache --non-interactive commit --file C:\Users\xuhuiw\AppData\Local\Temp\maven-scm-2074558159.commit --targets C:\Users\xuhuiw\AppData\Local\Temp\maven-scm-5719724778329125171-targets"
[INFO] Working directory: E:\workspace\mtest
[ERROR] Provider message:
[ERROR] The svn command failed.
[ERROR] Command output:
[ERROR] svn: 'E:\workspace\mtest' is not a working copy
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-scm-plugin:1.5:checkin (default-cli) on project mtest: Command failed.The svn command failed. ->
[Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-scm-plugin:1.5:checkin (default-cli) on project mtest: Command failed.
The svn command failed. at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217) at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84) at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) at
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) at
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:319) at
org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at
org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at
org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at
org.apache.maven.cli.MavenCli.main(MavenCli.java:141) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at
java.lang.reflect.Method.invoke(Method.java:597) at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290) at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230) at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352) Caused by:
org.apache.maven.plugin.MojoExecutionException: Command failed.The svn command failed. at
org.apache.maven.scm.plugin.AbstractScmMojo.checkResult(AbstractScmMojo.java:439) at
org.apache.maven.scm.plugin.CheckinMojo.execute(CheckinMojo.java:83) at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
[ERROR]
[ERROR]
And here is my 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>com.ftad.common.mtest</groupId>
<artifactId>mtest</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>mtest</name> <url>http://maven.apache.org</url>
<organization>
<name>众合广告</name>
</organization>
<properties>
<project.build.sourceEncoding>UTF-</project.build.sourceEncoding> </properties>
<scm>
<connection>scm:svn:https://192.168.10.44/svn/FTMobileAdNetwork/trunk/personal/xuhuiw/mvntest/mtest/</connection>
<developerConnection>scm:svn:https://192.168.10.44/svn/FTMobileAdNetwork/trunk/personal/xuhuiw/mvntest/mtest/</developerConnection>
</scm>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-plugin</artifactId>
<version>1.5</version>
<configuration>
<password>wangxuhui</password>
<username>xuhuiw</username>
<basedir>./</basedir>
<exportDirectory>target</exportDirectory>
<includes>src/*,pom.xml</includes>
<workingDirectory>./</workingDirectory>
</configuration>
<executions>
<execution>
<id>pref-scm</id>
<configuration>
<includes>src/*,pom.xml</includes>
<checkoutDirectory>./</checkoutDirectory>
</configuration>
<goals>
<goal>checkin</goal>
<goal>checkout</goal>
<goal>update</goal>
<goal>add</goal>
<goal>validate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
<distributionManagement>
<site>
<id>apache.website</id>
<url>scp://people.apache.org/www/maven.apache.org/scm/maven-scm-plugin</url>
</site>
<repository>
<id>releases</id>
<url>http://192.168.10.6:8081/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>http://192.168.10.6:8081/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
</project>
The important part is:
svn: 'E:\workspace\mtest' is not a working copy
So make sure your Maven task execute itself in an SVN working copy.
The directory you execute the scm:checkin from needs to be a svn working directory, which means you should have a ".svn" in that directory with the correct contents inside(the .svn is the svn admin directory which contains the pristine files downloaded).
Check if your .svn directory exists or if it's empty ( i found out that when I used "includes=*" in the checkout execution configuration, maven wipes out the .svn directory), which caused the subsequent scm:checkin to fail. And in your case, since you are using "includes=src/*,pom.xml", your .svn directory might not even exist.
To fix this, you can define execution for checkout in the maven-scm-plugin first (without using includes), then define a separate execution for add/check. And here's a pom.xml to do scm:checkout, curl download, then scm:checkin
http://mywallstreettechjob.blogspot.com/2015/06/maven-scm-plugin-pomxml-sample-for-svn.html

Resources