maven: Error transferring file: Connection refused: connect - maven

I am working in a network environment.
my network ip address for internet is:
IE->tools->internet options->connections->LAN settings->Use Automatic configuration script(enabled): Address: http://autocache.abc.com/
port address is not specified in IE settings.
when i do ping autocache.abc.com it gives following ip address: 16.234.18.243
in settings.xml file i have enabled entry for proxy as:
<proxy>
<id>genproxy</id>
<active>true</active>
<protocol>http</protocol>
<host>autocache.abc.com</host>
</proxy>
Nothing is specified at Ie host ie: IE->tools->connection->LAN settings->advanced->http shows empty
if i run mvn install getting following error:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building home-app
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 4 resources
Downloading: https://repository.jboss.org/nexus/content/repositories/releases//org/springframework/spring-parent/3.0.6.RELEASE/spring-parent-3.0.6.RELEASE.pom
[WARNING] Unable to get resource 'org.springframework:spring-parent:pom:3.0.6.RELEASE' from repository jboss (https://repository.jboss.org/nexus/content/repositories/releases/): Error transferring file: Connection refused: connect
Downloading: http://repository.springsource.com/maven/bundles/release/org/springframework/spring-parent/3.0.6.RELEASE/spring-parent-3.0.6.RELEASE.pom
[WARNING] Unable to get resource 'org.springframework:spring-parent:pom:3.0.6.RELEASE' from repository com.springsource.repository.bundles.release (http://repository.springsource.com/maven/bundles/release): Error transferring file: Connection refused: connect
Downloading: http://repository.springsource.com/maven/bundles/external/org/springframework/spring-parent/3.0.6.RELEASE/spring-parent-3.0.6.RELEASE.pom
[WARNING] Unable to get resource 'org.springframework:spring-parent:pom:3.0.6.RELEASE' from repository com.springsource.repository.bundles.external (http://repository.springsource.com/maven/bundles/external): Error transferring file: Connection refused: connect
Downloading: http://repo1.maven.org/maven2/org/springframework/spring-parent/3.0.6.RELEASE/spring-parent-3.0.6.RELEASE.pom
[WARNING] Unable to get resource 'org.springframework:spring-parent:pom:3.0.6.RELEASE' from repository central (http://repo1.maven.org/maven2): Error transferring file: Connection refused: connect
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: org.springframework:spring-orm:jar:3.0.6.RELEASE
Reason: Cannot find parent: org.springframework:spring-parent for project: org.springframework:spring-orm:jar:3.0.6.RELEASE for project org.springframework:spring-orm:jar:3.0.6.RELEASE
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11 seconds
[INFO] Finished at: Wed Feb 15 11:40:32 IST 2012
[INFO] Final Memory: 11M/27M
[INFO] ------------------------------------------------------------------------
If I run mvn install without network connection ie at my private internet connection, it is working fine and only problem is with network proxy.
I strongly feel it is host issue, if I give host as 16.234.18.243 instead of autocache.abc.com, still gives same error.
I tried to create new local repository( ie deleted existing directory), but still same issue.

1> open IE(or any browser),
2> give url as http://autocache.abc.com/ ( you have given above) and enter, a file will be downloaded with .pac format, save to desktop
3> open .pac file in textpad, identify PROXY:
In your editor, it will come something like:
return "PROXY web-proxy.ind.abc.com:8080; PROXY proxy.sgp.abc.com:8080";
4> go to Maven settings.xml and enter as:
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<host>web-proxy.ind.abc.com</host>
<port>8080</port>
</proxy>
5> run mvn:install through command prompt or run through eclipse.
go through maven-in-5-min-not-working

The URL you specified most likely contains a Proxy auto-config file . You need to download it and see what the proxy settings specified in it are.
For instance, the file contents
function FindProxyForURL(url, host)
{
return "PROXY proxy.example.com:8080; DIRECT";
}
indicates that you should use the proxy server proxy.example.com on port 8080.
For a more elaborate example, see How to configure Maven behind an auto configured proxy .

Related

Maven deploy error HTTP method PUT is not supported by this URL

If I use this command I can upload into Nexus...
mvn deploy:deploy-file -Dfile=target/common-2.0.0.jar -DgroupId=com.test -DartifactId=test-common -Dversion=2.0.0 -Dpackaging=jar -DrepositoryId=TEST-REPO -Durl=https://nexus.xxx.xxxx.net/content/repositories/test
If I use this command
mvn deploy -DskipTests -DrepositoryId=TEST-REPO -DaltReleaseDeploymentRepository=releases::default::https://nexus.xxxx.xxxx.net/repository/test/
I get this error message...
[INFO] --- maven-deploy-plugin:2.8.2:deploy (default-deploy) # common ---
[INFO] Using alternate deployment repository releases::default::https://nexus.xxx.xxx.net/repository/test/
Uploading to releases: https://nexus.xxx.xxx.net/repository/test/com/test/common/2.0.0/common-2.0.0.jar
Uploading to releases: https://nexus.xxx.xxx.net/repository/test/com/test/common/2.0.0/common-2.0.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:08 min
[INFO] Finished at: 2019-05-16T14:55:35+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project common:
Failed to deploy artifacts: Could not transfer artifact
com.test:common:jar:2.0.0 from/to releases (https://nexus.xxx.xxx.net/repository/test/):
Failed to transfer file: https://nexus.xxx.xxx.net/repository/test/common/common-2.0.0.jar. Return code is: 400, ReasonPhrase: HTTP method PUT is not supported by this URL. -> [Help 1]
Does anyone know if the command "deploy:deploy-file" uses HTTP POST but the command "deploy" uses HTTP PUT?
Or how I can force it to use HTTP POST?
Note:
The Nexus version is: Nexus Repository Manager OSS 2.14.4-03
Maven version is 3.0.5, and have tried 3.6.1
I found out that...
POST uploads are not supported in Nexus 3. Use a PUT instead.

Artifactory maven virtual repository 404s

I am trying to use a maven virtual repository that is linked up to an SBT local repository to resolve dependencies, but I keep getting 404s when I try to download the artifacts. They are listed fine on the UI, but right clicking on the artifacts and hitting "Download" give me a 404 error. Has anyone run into this problem. We're using JFrogs cloud hosted version of Artifactory on AWS. Our virtual Gradle repository is setup the same way and works as expected ...
mvn install output:
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building my-app 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.example:myjar:jar:1.0-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.220 s
[INFO] Finished at: 2018-04-13T10:41:55-03:00
[INFO] Final Memory: 9M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project my-app: Could not resolve dependencies for project com.mycompany.app:my-app:jar:1.0-SNAPSHOT: Failure to find com.example:myjar:jar:1.0-SNAPSHOT in https://example.jfrog.io/example/maven 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]
It seems that there are differences between snapshot policies between your local repositories referenced from the virtual one.
https://www.jfrog.com/jira/browse/RTFACT-17521

Nexus Artefact Upload Failure

using maven deploy command, I tried to upload artefacts of size (440 MB) in Nexus repository(Nexus Version : nexus-professional-2.13.0-01). Maven version is 3.5.2. Configured my proxy server details in settings.xml
mvn -e -X deploy:deploy-file -DgroupId=de.test.oca -DartifactId=wildfly-image -Dversion=0.0.1-SNAPSHOT -Dpackaging=tar.gz -Dfile=oca-wildfly-image-0.0.1-snapshot.tar.gz -DrepositoryId=oca-snapshots -Durl=http://xx.xx.xx:8081/nexus/content/repositories/oca-snapshots
Error Message :
Uploaded to oca-snapshots: http://xx.xx.xx:8081/nexus/content/repositories/oca-snapshots/de/test/oca/wildfly-image/0.0.1-SNAPSHOT/wildfly-image-0.0.1-20180117.094348-1.pom (446 B at 1.2 kB/s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 07:07 min
[INFO] Finished at: 2018-01-17T10:50:54+01:00
[INFO] Final Memory: 10M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli) on project standalone-pom: Failed to deploy artifacts: Could not transfer artifact de.test.oca:wildfly-image:tar.gz:0.0.1-20180117.094348-1 from/to oca-snapshots (http://xx.xx.xx:8081/nexus/content/repositories/oca-snapshots): Connection reset -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli) on project standalone-pom: Failed to deploy artifacts: Could not transfer artifact de.test.oca:wildfly-image:tar.gz:0.0.1-20180117.094348-1 from/to oca-snapshots (http://xx.xx.xx:8081/nexus/content/repositories/oca-snapshots): Connection reset
In Nexus GUI, I can able to find the tar.gz file uploaded. When I checked nexus.log, I found error message as
jvm 1 | 2018-01-17 14:27:17,706+0100 INFO [qtp1148931253-265705] admin com.sonatype.nexus.plugins.outreach.internal.outreach.SonatypeOutreach - Could not download page bundle
jvm 1 | org.apache.http.conn.ConnectionPoolTimeoutException: Timeout waiting for connection from pool
jvm 1 | 2018-01-17 14:27:47,710+0100 INFO [qtp1148931253-265708] admin com.sonatype.nexus.plugins.outreach.internal.outreach.SonatypeOutreach - Could not download page bundle
jvm 1 | org.apache.http.conn.ConnectionPoolTimeoutException: Timeout waiting for connection from pool
I tried to Upload another file with file sizw of 300MB, it works fine.
Is there any file size limit in the Nexus.
There is no filesize limit in Nexus itself. However there might be timeout issues, performance issues with the app or other issues with the underlying OS and filesystem.

How to scan my project using pdsoftplan/zap-maven-plugin? I need to know without installing zap server

I have a zap Maven plugin in my Maven pom.xml and I have provided goals as analyze. I didn't install zap server and in pom.xml I used as <shouldRunWithDocker>true</shouldRunWithDocker>. Please tell me the way to scan my project using Maven plugin. It is showing error as below.
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- zap-maven-plugin:1.2.1-0:analyze (default-cli) # IOPmsPerformanceTesting ---
[INFO] Starting ZAP analysis at target: https://example.com
[INFO] --- Validating authentication information ---
[INFO] Authentication information provided: AuthenticationInfo[type=CAS,loginUrl=https://example.com,username=12,password=679,extraPostData=,loggedInRegex=,loggedOutRegex=\QLocation:https://checkmarx.web.att.com\E.*,excludeFromScan=,protectedPages={https://checkmarx.web.att.com},loginRequestData=username={%username%}&password={%password%},usernameParameter=username,passwordParameter=password,httpSessionTokens=,seleniumDriver=Firefox,hostname=,realm=,port=80]
[INFO] The authentication information provided was successfully validated.
[INFO] --- Finished validating authentication information ---
[ERROR] Error creating a new ZAP session.
br.com.softplan.security.zap.zaproxy.clientapi.core.ClientApiException: java.net.ConnectException: Connection refused (Connection refused)
[ERROR] Error while trying to create the script file for CAS authentication in /zap/scripts/. The analysis will continue but CAS authentication will work only if the script file can be accessed by ZAP's Docker image (a default volume is created in /zap/scripts/).
java.io.FileNotFoundException: /zap/scripts/cas-auth.js (No such file or directory)
at java.io.FileOutputStream.open0(Native Method)
I suspect its because ZAP no longer allows you to connect to the API from remote IP addresses by default. You can override this from the ZAP command line: https://github.com/zaproxy/zaproxy/wiki/FAQapikey
Ideally the ZAP Maven Plugin should do this, but it doesnt look like thats been updated recently:/ https://github.com/pdsoftplan/zap-maven-plugin

Build issues with Hadoop on windows

I am trying to build hadoop on windows and I am following this link http://opensourceforu.efytimes.com/2015/03/getting-started-with-hadoop-on-windows/. However when I try to build the code using the command
mvn package -Pdist,native-win -DskipTests Dtar
I am getting the following error
[DEBUG] Writing tracking file C:\Users\SS\.m2\repository\org\s
onatype\plexus\plexus-cipher\1.4\_remote.repositories
[DEBUG] Writing tracking file C:\Users\SS\.m2\repository\org\s
onatype\plexus\plexus-cipher\1.4\plexus-cipher-1.4.jar.lastUpdated
[DEBUG] Writing tracking file C:\Users\SS\.m2\repository\org\a
pache\maven\plugin-tools\maven-plugin-annotations\3.4\_remote.repositories
[DEBUG] Writing tracking file C:\Users\SS\.m2\repository\org\a
pache\maven\plugin-tools\maven-plugin-annotations\3.4\maven-plugin-annotations-3
.4.jar.lastUpdated
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 25:08 min
[INFO] Finished at: 2016-03-21T17:02:06+05:30
[INFO] Final Memory: 13M/173M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project hadoop-maven-plugins: Could not resolv
e dependencies for project org.apache.hadoop:hadoop-maven-plugins:maven-plugin:2
.7.2: Could not transfer artifact org.apache.maven:maven-model:jar:3.0 from/to c
entral (https://repo.maven.apache.org/maven2): GET request of: org/apache/maven/
maven-model/3.0/maven-model-3.0.jar from central failed: SSL peer shut down inco
rrectly -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
n project hadoop-maven-plugins: Could not resolve dependencies for project org.a
pache.hadoop:hadoop-maven-plugins:maven-plugin:2.7.2: Could not transfer artifac
t org.apache.maven:maven-model:jar:3.0 from/to central (https://repo.maven.apach
e.org/maven2): GET request of: org/apache/maven/maven-model/3.0/maven-model-3.0.
jar from central failed
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDe
pendencies(LifecycleDependencyResolver.java:221)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resol
veProjectDependencies(LifecycleDependencyResolver.java:127)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAr
eResolved(MojoExecutor.java:245)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:199)
I am using a windows 7 enterprise 64 bit machine and there is no proxy configured in IE. Can somebody help me to resolve this issue?
Thank you,
Using openssl s_client -connect servername:443 you can debug what protocol the server supports and perform tests by forcing flags like ssl2, ssl2, check this

Resources