Maven deployment timeout / failure to generate checksums - java

I'm trying to deploy an artifact to clojars which provides a public Maven repository.
When I run the deployment I get a failure at the end with the following output, apparently after a 60 secs timeout:
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) # clisk ---
Uploading: https://clojars.org/repo/net/mikera/clisk/0.3.0/clisk-0.3.0.jar
Uploading: https://clojars.org/repo/net/mikera/clisk/0.3.0/clisk-0.3.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:13.466s
[INFO] Finished at: Tue Aug 07 08:51:00 SGT 2012
[INFO] Final Memory: 21M/253M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project clisk: Failed to deploy artifacts: Could not transfer artifact net.mikera:clisk:jar:0.3.0 from/to clojars (https://clojars.org/repo): No response received after 60000 -> [Help 1]
Interestingly, the following happens:
The jar and the pom are successfully deployed (I can see them in the repo)
The various MD5 / SHA1 checksums are not generated
Further links:
The reported issue
The pom.xml
I'm using the built-in Maven support within Eclipse Juno
What am I doing wrong?

This isn't a complete solution but a workaround I found, posted here in case anyone else needs it.
Build the code and install in the local repository with "Run As.../Maven Install"
Make sure pageant is running with your SSH key (from the PuTTY suite). The SSH key must match the public key you provide to Clojars in your profile
Open a console and cd into the ".m2" local repository directory to find you .pom and .jar files
Run the following command:
pscp -scp *.pom *.jar clojars#clojars.org:
This seems to work successfully: Clojars itself will generate the required checksum files.

Related

Problem with Maven plugin :maven-enforcer-plugin:3.0.0-M3:enforce Some Enforcer rules have failed

A little bit of context:
Im working as a FE developer for an AEM project. The project is a SPA AEM as cloud service. I am running the author instance from the command line.
My pc specs are:
CPU: Intel(R) Core(TM) i5-7400 CPU # 3.00GHz 3.00 GHz
RAM: 24.0 GB
SSD: 476 GB
OS: Windows 10 Pro
For the AEM Project we are using
Java sdk 11
Maven 3.6.3
I have already set up everything, the path variables, JAVA_HOME, mvn. All of them work fine, even trying to build other type of projects with "older" versions of AEM like 6.5 build perfectly. I don't have a problem with them. But with this version of AEM I am getting this error
[WARNING] Rule 9: org.apache.maven.plugins.enforcer.RequireFileChecksum failed with message:
There have been changes detected in a file which is supposed to be immutable according to https://docs.adobe.com/content/help/en/experience-manager-cloud-service/implementing/content-delivery/disp-overview.html#file-structure: src/conf.dispatcher.d/renders/default_renders.any
[WARNING] Rule 10: org.apache.maven.plugins.enforcer.RequireFileChecksum failed with message:
There have been changes detected in a file which is supposed to be immutable according to https://docs.adobe.com/content/help/en/experience-manager-cloud-service/implementing/content-delivery/disp-overview.html#file-structure: src/conf.dispatcher.d/virtualhosts/default_virtualhosts.any
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for xxxxxx 1.0.0-SNAPSHOT:
[INFO]
[INFO] xxxxxx ................................. SUCCESS [ 0.270 s]
[INFO] xxxxxx - Core .......................... SUCCESS [ 59.232 s]
[INFO] xxxxxx - UI Frontend ................... SUCCESS [ 19.876 s]
[INFO] xxxxxx - UI Frontend React ............. SUCCESS [ 39.613 s]
[INFO] xxxxxx - Repository Structure Package .. SUCCESS [ 0.991 s]
[INFO] xxxxxx - UI apps ....................... SUCCESS [ 12.990 s]
[INFO] xxxxxx - UI content .................... SUCCESS [ 4.178 s]
[INFO] xxxxxx - UI config ..................... SUCCESS [ 0.314 s]
[INFO] xxxxxx - All ........................... SUCCESS [ 1.052 s]
[INFO] xxxxxx - Integration Tests ............. SUCCESS [ 12.166 s]
[INFO] xxxxxx - Dispatcher .................... FAILURE [ 0.030 s]
[INFO] xxxxxx - UI Tests ...................... SKIPPED
[INFO] xxxxxx - Project Analyser .............. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:34 min
[INFO] Finished at: 2021-08-22T15:11:20-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce (enforce-checksum-of-immutable-files) on project xxxxxxx.dispatcher.cloud: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <args> -rf :xxxxxx.dispatcher.cloud
I've been searching in sites, some of the answers for this problem haven't work for me.
I tried to run everything from the "gitbash"
command line and I had the same problem.
I tried to change the version in the pom.xml, didnt work.
I tried to build the project using eclipse IDE and all the build-in tools, I get an error that org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M3:enforce is missing
Disable firewall and antivirus, nope
Use other versions of maven like 3.8.2
Delete the .m2 directory and download again all the plugins, not working
One of many answers tell me to comment out the dispatcher module in the pom.xml and after I did that builds fine. Other is doing the same and upload the ui.apps/target/*.zip with the crx package manager I did it but im not sure if the result is the "best".
To end, I installed the same project in a Mac Pro and i did without a problem. I hope someone can help me with this. Thanks for reading.
[WARNING] Rule 9: org.apache.maven.plugins.enforcer.RequireFileChecksum failed with message:
There have been changes detected in a file which is supposed to be immutable according to https://docs.adobe.com/content/help/en/experience-manager-cloud-service/implementing/content-delivery/disp-overview.html#file-structure: src/conf.dispatcher.d/renders/default_renders.any
The Maven Enforcer Plugin is checking for some files to have an specific checksum using requireFileChecksum rule
Somewhere in your pom.xml the Enforcer Maven plugin should be declared, so you will be able to see the rule and the hash it is applying. This xml snippet is from the maven plugin documentation.
<requireTextFileChecksum>
<file>E:\java-workspace\apache-maven-enforcer\maven-enforcer\target\checkout\enforcer-rules\target\classes/foo.txt</file>
<checksum>d41d8cd98f00b204e9800998ecf8427e</checksum>
<type>md5</type>
</requireTextFileChecksum>
Check that hash against the hash of the file of your filesystem. Maybe when you change aem version, you need to upgrade some of those files.
As discussed here: https://github.com/adobe/aem-guides-wknd/pull/202
Adobe have reported the issue and the fix to Adobe AEM WKND project:
Some Windows users experience a Maven enforcer issue where it appears that default dispatcher files have been modified. Unclear if this is a result of differences between Mac and Windows or something that occurs during the checkout process. Most users simply want to install the code base to a local environment and this check is unnecessary. Removing the enforcement for windows builds.
so you can :
Skips Dispatcher enforcement plugin for users on windows environments.
doing a change you dispatcher/pom.xml
with the commit reported here:
https://github.com/adobe/aem-guides-wknd/pull/202/commits/bebcf5d2236c75a95055d5ff71ea58f66379f271
replacing the line:
<goal>enforce</goal>
with:
<goal>display-info</goal>

Why my maven package triggered by Jenkins failed but can be success if I manually execute it?

I have a jenkins job which tend to build my java application using maven, but it always gets failure during the compile phase.
[[1;34mINFO[m] Changes detected - recompiling the module!
[[1;34mINFO[m] Compiling 550 source files to /var/lib/jenkins/workspace/test/target/classes
[[1;34mINFO[m] [1m------------------------------------------------------------------------[m
[[1;34mINFO[m] [1;31mBUILD FAILURE[m
[[1;34mINFO[m] [1m------------------------------------------------------------------------[m
[[1;34mINFO[m] Total time: 9.575 s
[[1;34mINFO[m] Finished at: 2017-12-02T07:47:47+08:00
[[1;34mINFO[m] Final Memory: 24M/346M
[[1;34mINFO[m] [1m------------------------------------------------------------------------[m
[[1;33mWARNING[m] The requested profile "nexus" could not be activated because it does not exist.
[[1;31mERROR[m] Failed to execute goal [32morg.apache.maven.plugins:maven-compiler-plugin:3.1:compile[m [1m(default-compile)[m on project [36mtest[m: [1;31mCompilation failure[m -> [1m[Help 1][m
[[1;31mERROR[m]
I find and copied the below command in the Jenkins job's console output(on the webpage).
/opt/apache-maven-3.5.0/bin/mvn -f pom.xml -s /var/lib/jenkins/test-maven-setting/setting.xml -gs /var/lib/jenkins/test-maven-setting/setting.xml -Dmaven.repo.local=/var/lib/jenkins/workspace/test/.repository clean package
Then I switched to the jenkins user in the Linux console and go to the job's workspace directory and tried to manually execute the above commands I copied.
but it success!
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.994 s
[INFO] Finished at: 2017-12-02T07:50:17+08:00
[INFO] Final Memory: 35M/298M
so it's very strange, same commands, same user, same directory, but it can success when I execute it manually while fail when Jenkins build the job. Does anyone know what's the problem that Jenkins job failed?
here I retested the maven plugin and pasted some screenshots.
You as using "use default maven settings" option in invoke-maven-targets.
select option for "settings file in filesystem" for both default and global

Error while building Hadoop src using maven

I want to install hadoop single node setup on windows7 64 bit. I have installed cygwin, windows SDK 7.1, maven 3.1.1 and jdk 1.6.33.
Running Hadoop single node setup on windows 7 is very trooublesome.
While buiding the "mvn package -Pdist,native-win -DskipTests -Dtar" i am getting below error.
Can someone help how to fix this error or any other way to build hadoop on windows 7 64 bit?
portion of the Error log is as follows:
[INFO] Apache Hadoop Main ................................ SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 41.461s
[INFO] Finished at: Wed Jun 11 19:42:25 IST 2014
[INFO] Final Memory: 53M/339M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.
5.1:compile (default-compile) on project hadoop-common: Compilation failure: Com
pilation failure:
[ERROR] D:\hdfs\hadoop-common-project\hadoop-common\src\main\java\org\apache\had
oop\ipc\protocolPB\RefreshCallQueueProtocolPB.java:[26,65] package org.apache.ha
doop.ipc.proto.RefreshCallQueueProtocolProtos does not exist
[ERROR] D:\hdfs\hadoop-common-project\hadoop-common\src\main\java\org\apache\had
oop\ipc\protocolPB\RefreshCallQueueProtocolPB.java:[36,33] package RefreshCallQu
eueProtocolService does not exist
[ERROR] D:\hdfs\hadoop-common-project\hadoop-common\src\main\java\org\apache\had
oop\ipc\protocolPB\RefreshCallQueueProtocolServerSideTranslatorPB.java:[24,65] p
ackage org.apache.hadoop.ipc.proto.RefreshCallQueueProtocolProtos does not exist
You can download the latest hadoop release from this url:
http://apache.mirrors.tds.net/hadoop/common/stable/hadoop-2.2.0.tar.gz
You are complicating yourself for no reason: you only need to build hadoop in windows if your system is 32 bits (and good luck on that: I've been trying it for 3 weeks!). Since your system is 64 all you need to do is download a precompiled package

Maven 3: Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate

I'm trying to test maven using
mvn archetype:generate -DgroupId=org.sonatype.mavenbook -DartifactId=quickstart -Dversion=1.0-SNAPSHOT -DpackageName=org.sonatype.mavenbook -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.0 -DinteractiveMode=false
After several minutes, the system shows me this:
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-catalog/2.2/archetype-catalog-2.2.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-catalog/2.2/archetype-catalog-2.2.pom (2 KB at 4.4 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-models/2.2/archetype-models-2.2.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/archetype/archetype-models/2.2/archetype-models-2.2.pom (3 KB at 5.8 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.5.8/plexus-utils-1.5.8.pom
Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.5.8/plexus-utils-1.5.8.pom (8 KB at 17.0 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus/2.0.2/plexus-2.0.2.pom
Downloading: http://repo.maven.apache.org/maven2/org/apache/ant/ant-parent/1.8.1/ant-parent-1.8.1.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 30:36.874s
[INFO] Finished at: Tue Feb 07 15:59:39 BRST 2012
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project standalone-pom: Execution default-cli of goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate failed: Plugin org.apache.maven.plugins:maven-archetype-plugin:2.2 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.plugins:maven-archetype-plugin:jar:2.2 (): Failed to read artifact descriptor for org.codehaus.plexus:plexus-utils:jar:1.5.8: Could not transfer artifact org.codehaus.plexus:plexus:pom:2.0.2 from/to central (http://repo.maven.apache.org/maven2): Read timed out -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
How can I fix this? Thanks in advance!
I too encountered the same problem when I created a project using Idea IDE. Using the below method you can create a stand alone application or a web application without getting any error.
Go to the Terminal. Type below mentioned commands and execute.
For a web application:
mvn archetype:generate -DgroupId={project-packaging} -DartifactId={project-name} -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false
For a stand alone application:
mvn archetype:generate -DgroupId={project-packaging} -DartifactId={project-name} -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
This will create the project structure by downloading relevant jars etc. When this is done the project structure has been created. Open up an IDE and direct it to created Project`s Pom.xml file.
The error is:
Failed to read artifact descriptor for org.codehaus.plexus:plexus-utils:jar:1.5.8: Could not transfer artifact org.codehaus.plexus:plexus:pom:2.0.2 from/to central (http://repo.maven.apache.org/maven2): Read timed out
Try again when your network works better (internet connection is better).
Check with ping if you can connect to the http://repo.maven.apache.org/maven2.
may be you should try in the root mode : try with sudo + command
I have encountered this problem when my machine is behind a firewall (corporate network) and I have not set up a proxy in ~/.m2/settings.xml.
The opposite could also be true, a proxy has been defined, but you're no longer connected to that network.
Details about Maven's settings.xml can be found here.
I had the same problem. Maven can't seem to view the plugins, in this case the archetype. This is a network problem. Are you behind a proxy or firewall? If so, follow the instructions given here. Otherwise, set your firewall permissions and you can try using sudo too.

Maven release plugin fails when creating tag

I'm trying to use Maven release plugin 2.0 to tag the version and hopefully deploy the resulting jar to the repository.
I got stuck at release:prepare, getting this cryptic error:
[INFO] Checking in modified POMs...
[INFO] Executing: cmd.exe /X /C "svn --non-interactive commit --file C:\Users\ME~1\AppData\Local\Temp\maven-scm-950614965.commit --targets C:\Users\ME~1\AppData\Local\Temp\maven-scm-35306-targets"
[INFO] Working directory: c:\workspace\release-test-trunk
[INFO] Tagging release with the label release-test-1.3.0...
[INFO] Executing: cmd.exe /X /C "svn --non-interactive copy --file C:\Users\ME~1\AppData\Local\Temp\maven-scm-829250416.commit --revision 1885 http://myserver/myproject/sandbox/release-test/trunk http://myserver/myproject/sandbox/release-test/tags/release-test-1.3.0"
[INFO] Working directory: c:\workspace\release-test-trunk
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Unable to tag SCM
Provider message:
The svn tag command failed.
Command output:
svn: OPTIONS of 'http://myserver/myproject/sandbox/release-test': 200 OK (http://myserver)
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20 seconds
[INFO] Finished at: Tue Aug 24 19:31:55 GMT 2010
[INFO] Final Memory: 14M/56M
[INFO] ------------------------------------------------------------------------
The tag folder does exist and is empty
I executed the command mvn clean release:clean release:prepare to be sure have a fresh run
Every time I got the error I executed mvn release:rollback to have everything back to normal
It doesn't seem to be a credentials problem, the pom file is effectively commited with the -SNAPSHOT removed and the scm information switched to the tag folder.
The strange part is I don't understand how the pom file is commited since I did not specify any credentials neither in the pom nor in the settings.xml file located in maven local install
I saw many people having a similar issue but with the folder already exist error message. Mine doesn't tell me what the error is precisely.
Do you have any ideas ?
Many thanks.
EDIT:
#Colin
If I browse svn://myserver/myproject/sandbox/release-test using tortoise svn for example it works fine. However if I type http://myserver/myproject/sandbox/release-test in Firefox the page is not found.
Also I think it should be ok since the pom file gets commited before trying to create the tag.
My scm section in the pom file :
<scm>
<connection>scm:svn:http://myserver/myproject/sandbox/release-test/tags/release-test-1.3.0</connection>
<developerConnection>scm:svn:http://myserver/myproject/sandbox/release-test/tags/release-test-1.3.0</developerConnection>
<url>http://myserver/myproject/sandbox/release-test/tags/release-test-1.3.0</url>
</scm>
I tried removing the "http:" but that didn't work.
The problem isn't really maven here. It's more about svn itself. Maven stops its operation when svn send this error message :
svn: OPTIONS of 'http://myserver/myproject/sandbox/release-test': 200 OK (http://myserver)
Are you absolutly sure about the http://myserver/myproject/sandbox/release-test adress ?
If http://myserver/myproject/sandbox/release-test doesn't exists svn won't commit anything. Just replace the http:// by svn://
<scm>
<connection>scm:svn:svn://myserver/myproject/sandbox/release-test/tags/release-test-1.3.0</connection>
<developerConnection>scm:svn:svn://myserver/myproject/sandbox/release-test/tags/release-test-1.3.0</developerConnection>
<url>svn://myserver/myproject/sandbox/release-test/tags/release-test-1.3.0</url>
</scm>
Links :
svnforum.org
An SVN error (200 OK) when checking out from my online repo
Tortoise svn Subversion Update Error

Categories