Maven - Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.4:single (1-pre-dist) on project - maven

I'm using wso2 emm 2.2.0 Beta, Please refer the below error console. when I run the maven install I got maven assembly plugin issue.
So please let me know why it occurs? and give some suggestion to fix this problem.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WSO2 Mobile Device Manager (MDM) - Distribution 2.2.0-BETA2
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- incremental-build-plugin:1.3:incremental-build (default) # wso2emm ---
[INFO] Verifying module descriptor ...
[INFO] Verifying parent modules...
[INFO] Verifying resources...
[INFO] Resources directory does not exist : /home/next/Praveen/Project/secureON/Project/Project_Setup/product-emm-2.2.0-BETA2/modules/distribution/src/main/resources
[INFO] Verifying sources...
[INFO] No sources to check ...
[INFO]
[INFO] --- buildnumber-maven-plugin:1.3:create (default) # wso2emm ---
[INFO] Storing buildNumber: 27 Oct 2016 at timestamp: 1477554746130
[WARNING] Cannot get the branch information from the git repository:
Detecting the current branch failed: fatal: Not a git repository (or any of the parent directories): .git
[INFO] Executing: /bin/sh -c cd /home/next/Praveen/Project/secureON/Project/Project_Setup/product-emm-2.2.0-BETA2/modules/distribution && git rev-parse --verify HEAD
[INFO] Working directory: /home/next/Praveen/Project/secureON/Project/Project_Setup/product-emm-2.2.0-BETA2/modules/distribution
[INFO] Storing buildScmBranch: UNKNOWN_BRANCH
[INFO]
[INFO] --- maven-remote-resources-plugin:1.5:process (default) # wso2emm ---
[INFO]
[INFO] --- maven-assembly-plugin:2.4:single (1-pre-dist) # wso2emm ---
[INFO] Reading assembly descriptor: /home/next/Praveen/Project/secureON/Project/Project_Setup/product-emm-2.2.0-BETA2/modules/distribution/src/assembly/dist.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.203s
[INFO] Finished at: Thu Oct 27 13:22:26 IST 2016
[INFO] Final Memory: 13M/188M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.4:single (1-pre-dist) on project wso2emm: Failed to create assembly: Error creating assembly archive dist: You must set at least one file.

If you want to build WSO2 EMM 2.2.0 Beta follows the below steps.
Clone the product-emm repo
git clone https://github.com/wso2/product-emm.git
Checkout the v2.2.0-BETA tag.
git checkout v2.2.0-BETA
Build from root pom. Go to project root folder and issue
mvn clean install
If you want just product zip you can build the distribution module for that go to project root -> modules ->distribution folder and issue mvn clean install from there. you can find the build zip file in distribution/target folder.
It seems like you are in master branch. The failing maven goal for you added after the emm beta tag creation. The reason for failing is, in build time it tries to connect to some resources in internet and your computer failed to connect to that resources on internet. If you really want to build the master branch (2.2.0-SNAPSHOT), just check your internet connection or firewall blockings.

Related

How to use gradle-enterprise-maven-extension behind a proxy?

Willing to use the gradle-enterprise-maven-extension
to migrate a project from maven to gradle,
I cloned the maven-build-scan-quickstart provided by the gradle team.
But runing mvn install, as specified, after acceptation of gradle terms of service,
I receive the following message:
UnknownHostException: scans-in.gradle.com
I tried to configure the proxy in several manners:
Using commannd line option:
mvn install -Dhttps.proxyHost=localhost:8888 -Dhttps.proxyPort=localhost:8888
Using a gradle.properties file in a directory at %GRADLE_USER_HOME% directory location:
(proxy is also configured in maven's settings.xml and need no password it works fine when using maven in standard ways)
gradle.properties :
systemProp.http.proxyHost=localhost
systemProp.http.proxyPort=8888
systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost|127.0.0.1
systemProp.https.proxyHost=localhost
systemProp.https.proxyPort=8888
systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost|127.0.0.1
But I still receive the same message:
~/github/maven-build-scan-quickstart
$ mvn install
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.830 s
[INFO] Finished at: 2019-12-31T13:09:19+01:00
[INFO] ------------------------------------------------------------------------
[INFO] 7 goals, 7 executed
Publishing a build scan to scans.gradle.com requires accepting the Gradle Terms of Service defined at https://gradle.com/terms-of-service. Do you accept these terms? (yes/no): yes
[INFO] Gradle Terms of Service accepted.
[INFO]
[INFO] Publishing build scan...
[INFO]
[INFO] A network error occurred.
[INFO]
[INFO] The hostname 'scans-in.gradle.com' could not be resolved.
[INFO] You may be disconnected from the Internet.
[INFO]
[INFO] If you require assistance with this problem, please report it via https://gradle.com/help/plugin and include the following information via copy/paste.
[INFO]
[INFO] ----------
[INFO] Maven version: 3.6.2
[INFO] Extension version: 1.3.3
[INFO] Request URL: https://scans-in.gradle.com/in/maven/3.6.2/1.3.3
[INFO] Request ID: 1234567e-abcd-23de-c2d3-3fbbccd14a32
[INFO] Exception: java.net.UnknownHostException: scans-in.gradle.com
[INFO] ----------
[INFO]

How to debug "The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exist or no valid version could be found"?

This is what I am trying to do. I have installed Maven. Set the path till bin folder of Maven.
C:\Workspace\Eaxample>mvn archetype:generate -DgroupId=com.mkyong -DartifactId=N
umberGenerator
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] org.apache.maven.plugins: checking for updates from central
[WARNING] repository metadata for: 'org.apache.maven.plugins' could not be retri
eved from repository: central due to an error: Error transferring file: Connecti
on timed out: connect
[INFO] Repository 'central' will be blacklisted
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exi
st or no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21 seconds
[INFO] Finished at: Tue Nov 24 14:04:15 IST 2015
[INFO] Final Memory: 5M/122M
You forget archetypeArtifactId :
Do this :
mvn archetype:generate -DgroupId={project-packaging}
-DartifactId={project-name}
-DarchetypeArtifactId=maven-archetype-quickstart
-DinteractiveMode=false
http://www.mkyong.com/maven/how-to-create-a-java-project-with-maven/

"Auth fail" error with maven-scm-provider-jgit during release:prepare

I am on a windows machine where git command line is not installed. I have installed GitExtensions and an EGit and this is sufficient for me (until now).
Now I wanted to perform a maven release to BinTray, following this guide:
Publishing releases using Github, Bintray and maven-release-plugin
Running:
mvn -Prelease release:prepare
Produces this output:
[INFO] ------------------------------------------------------------------------
[INFO] Building xxxxx 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-release-plugin:2.4.1:prepare (default-cli) # xxxxx ---
[INFO] Resuming release from phase 'scm-commit-release'
[INFO] Checking in modified POMs...
[INFO] Executing: cmd.exe /X /C "git add -- pom.xml"
[INFO] Working directory: C:\Users\jbr\git\yyyyyyyyyyyyyyy
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.770 s
[INFO] Finished at: 2015-09-12T20:17:24+02:00
[INFO] Final Memory: 20M/989M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.4.1:prepare (default-cli) on project xxxxx: Unable to commit files
[ERROR] Provider message:
[ERROR] The git-add command failed.
[ERROR] Command output:
[ERROR] 'git' is not recognized as an internal or external command,
[ERROR] operable program or batch file.
Absolutely fair, I never use the git command from the windows shell and I never set up the pageant.exe stuff. (for details see this answer to the question “Why git can't remember my passphrase under Windows”).
My second idea was to use the maven-scm-provider-jgit to not depend on the git command line.
The output is now:
[INFO] ------------------------------------------------------------------------
[INFO] Building xxxxx 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-release-plugin:2.4.1:prepare (default-cli) # xxxxx ---
[INFO] Change the default 'git' provider implementation to 'jgit'.
[INFO] Resuming release from phase 'scm-commit-release'
[INFO] Checking in modified POMs...
[INFO] push changes to remote... refs/heads/master:refs/heads/master
[INFO] fetch url: git#github.com:jmini/yyyyyyyyyyyyyyy.git
[INFO] push url: git#github.com:jmini/yyyyyyyyyyyyyyy.git
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.4.1:prepare (default-cli) on project xxxxx: An error is occurred in the checkin process: Exception while executing SCM command. JGit checkin failure! git#github.com:jmini/yyyyyyyyyyyyyyy.git: Auth fail -> [Help 1]
Much better, but still no luck.
My guess is that the private key and the passphrase are not loaded. How should I configure them?
This answer suggests that for some SCM providers, it is possible to specify the credentials in the <servers> section of settings.xml. The domain name of the repository should be used as <id>.
According to the last comment with scm:git:ssh://git#bitbucket.org/{account}/{project} used in the <developerConnection>, this entry is working in the settings.xml:
<server>
<id>bitbucket.org</id>
<privateKey>/c/Users/neil.hunt/.ssh/id_rsa</privateKey>
</server>
Is this construct supported by the JGit SCM provider?
When searching for “Auth failed” error, I found this related question (plain JGit, no maven plugin):
How do you set the configuration for jschconfigsessionfactory for jgit so that pull and push work?

Using maven-release-plugin with GitHub "You can't push to git://github.com/..."

Recently having switched source code repository for a project to GitHub from SourceForge I need to update the maven release process to match. I followed this link for configuring the "scm" section of the pom. The GitHub repository is shown here. Everything else is as it was when using SVN (for publishing to https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-4.MavenRepositories). So then I invoke
mvn clean release:clean release:prepare release:perform
and the output is as follows
[INFO] --- maven-release-plugin:2.1:prepare (default-cli) # datanucleus-maven-parent ---
[INFO] Verifying that there are no local modifications...
[INFO] ignoring changes on: pom.xml.next, release.properties, pom.xml.releaseBackup, pom.xml.backup, pom.xml.branch, pom.xml.tag
[INFO] Executing: /bin/sh -c cd /home/andy/work/datanucleus/datanucleus-maven-parent && git status
[INFO] Working directory: /home/andy/work/datanucleus/datanucleus-maven-parent
[INFO] Checking dependencies and plugins for snapshots ...
What is the release version for "DataNucleus Maven parent project"? (org.datanucleus:datanucleus-maven-parent) 3.3: :
What is SCM release tag or label for "DataNucleus Maven parent project"? (org.datanucleus:datanucleus-maven-parent) datanucleus-maven-parent-3.3: :
What is the new development version for "DataNucleus Maven parent project"? (org.datanucleus:datanucleus-maven-parent) 3.4-SNAPSHOT: :
[INFO] Transforming 'DataNucleus Maven parent project'...
[INFO] Not generating release POMs
[INFO] Executing goals 'clean verify'...
[INFO] Executing: /bin/sh -c cd /home/andy/work/datanucleus/datanucleus-maven-parent && /usr/local/maven3/bin/mvn clean verify --no-plugin-updates -Psonatype-oss-release -P development
[WARNING] Command line option -npu is deprecated and will be removed in future Maven versions.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building DataNucleus Maven parent project 3.3
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) # datanucleus-maven-parent ---
[INFO] Deleting /home/andy/work/datanucleus/datanucleus-maven-parent (includes = [*.log], excludes = [])
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) # datanucleus-maven-parent ---
[INFO]
[INFO] --- maven-bundle-plugin:2.4.0:manifest (default) # datanucleus-maven-parent ---
[WARNING] Ignoring project type pom - supportedProjectTypes = [jar, bundle]
[INFO]
[INFO] --- maven-source-plugin:2.1.2:jar-no-fork (attach-sources) # datanucleus-maven-parent ---
[INFO]
[INFO] --- maven-javadoc-plugin:2.7:jar (attach-javadocs) # datanucleus-maven-parent ---
[INFO] Not executing Javadoc as the project is not a Java classpath-capable package
[INFO]
[INFO] --- maven-gpg-plugin:1.1:sign (sign-artifacts) # datanucleus-maven-parent ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.535s
[INFO] Finished at: Sat Dec 14 08:51:07 GMT 2013
[INFO] Final Memory: 14M/491M
[INFO] ------------------------------------------------------------------------
[INFO] Checking in modified POMs...
[INFO] Executing: /bin/sh -c cd /home/andy/work/datanucleus/datanucleus-maven-parent && git add -- pom.xml
[INFO] Working directory: /home/andy/work/datanucleus/datanucleus-maven-parent
[INFO] Executing: /bin/sh -c cd /home/andy/work/datanucleus/datanucleus-maven-parent && git status
[INFO] Working directory: /home/andy/work/datanucleus/datanucleus-maven-parent
[INFO] Executing: /bin/sh -c cd /home/andy/work/datanucleus/datanucleus-maven-parent && git commit --verbose -F /tmp/maven-scm-1907822841.commit pom.xml
[INFO] Working directory: /home/andy/work/datanucleus/datanucleus-maven-parent
[INFO] Executing: /bin/sh -c cd /home/andy/work/datanucleus/datanucleus-maven-parent && git symbolic-ref HEAD
[INFO] Working directory: /home/andy/work/datanucleus/datanucleus-maven-parent
[INFO] Executing: /bin/sh -c cd /home/andy/work/datanucleus/datanucleus-maven-parent && git push git://github.com/datanucleus/datanucleus-maven-parent.git master:master
[INFO] Working directory: /home/andy/work/datanucleus/datanucleus-maven-parent
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.885s
[INFO] Finished at: Sat Dec 14 08:51:07 GMT 2013
[INFO] Final Memory: 15M/491M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.1:prepare (default-cli) on project datanucleus-maven-parent: Unable to commit files
[ERROR] Provider message:
[ERROR] The git-push command failed.
[ERROR] Command output:
[ERROR] fatal: remote error:
[ERROR] You can't push to git://github.com/datanucleus/datanucleus-maven-parent.git
[ERROR] Use https://github.com/datanucleus/datanucleus-maven-parent.git
Now a connection of "scm:git:git://github.com/{organization}/{project}.git" is what all examples I've seen for maven-release-plugin so would appreciate any insight in why it doesn't work here, or what I could look at to find out why. I can do a git push to the same URL using the user I'm logged on here as (GitHub has the SSH key).
I tried swapping the scm connection/developerConnection over to https and then get username/password prompted and it then hangs (it updates the GitHub repo with the version without SNAPSHOT) but that's all.
Actually the problem was more of believing web links of how you should configure your SCM section, so I post the answer here in case anyone else hits this message. The connection/developerConnection should be of the form
scm:git:git#github.com:{organization}/{project}.git

Hudson: Builds of multi-module maven project fail, then immediately succeed again

I have a multi-module project where the top level project serves both as the parent of the individual modules and as the project that declares the modules. Only this top level project is configured in Hudson (including automatic SVN checkout). The simplified layout is as follows:
ProjectRoot\
|
+---kernel\
| |
| +---pom.xml [ArtifactId=MyProject_kernel parent=MyProject]
|
+---model_foo\
| |
| +---pom.xml [ArtifactId=MyProject_model_foo, parent=MyProject]
|
+---pom.xml [ArtifactId=MyProject, parent=none]
Also, model_foo has a dependency on kernel.
Now, Hudson automatically discovers the kernel and model_foo sub projects, and it usually manages to build everything just fine.
However, each time I make a breaking change, such as create a new class in kernel and use it inside model_foo, I get a failing build for model_foo, followed by one that succeeds. The mail notifications are titled
Build failed in Hudson: MyProject » MyProject Model Foo #1545
Hudson build is back to normal : MyProject » MyProject Model Foo #1546
Why is that? I suspect it might have to do with the fact that the MyProject pom.xml is both the multi-module project and the parent of its modules, but before changing that I would like to know whether it's actually going to help.
I use Hudson 2.1.0.
Update
This is the log of a failed build of the web module (equals model_foo in the diagram above). The build for the MyProject root project had the same build number, and succeeded.
I stripped out the actual compiler errors, which are exactly the same as if the newly introduced class was missing.
Started by upstream project "MyProject" build number 1545
Found mavenVersion 2.0.9 from file jar:file:/home/builder/opt/apache-maven-2.0.9/lib/maven-2.0.9-uber.jar!/META-INF/maven/org.apache.maven/maven-core/pom.properties
$ /home/builder/opt/jdk1.5.0_22//bin/java -Xmx1024m -Xms512m -cp /home/builder/var/hudson/plugins/maven-plugin/WEB-INF/lib/maven-agent-2.1.0.jar:/home/builder/opt/apache-maven-2.0.9/boot/classworlds-1.1.jar hudson.maven.agent.Main /home/builder/opt/apache-maven-2.0.9 /home/builder/opt/apache-tomcat-6.0.24/webapps/hudson/WEB-INF/lib/hudson-remoting-2.1.0.jar /home/builder/var/hudson/plugins/maven-plugin/WEB-INF/lib/maven-interceptor-2.1.0.jar 48555
<===[HUDSON REMOTING CAPACITY]===> channel started
Executing Maven: -N -B -f <http://ciserver:8080/hudson/job/MyProject/com.mycompany.myproject$web/ws/pom.xml> clean deploy -Dworkspace.path=/home/builder/var/hudson/jobs/MyProject/workspace/ -Droot.project.name=MyRoot -e
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building MyProject
[INFO] task-segment: [clean, deploy]
[INFO] ------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory <http://ciserver:8080/hudson/job/MyProject/com.mycompany.myproject$web/ws/target>
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 945 source files to <http://ciserver:8080/hudson/job/MyProject/com.mycompany.myproject$web/ws/target/classes>
[HUDSON] Archiving <http://ciserver:8080/hudson/job/MyProject/com.mycompany.myproject$web/ws/pom.xml> to /home/builder/var/hudson/jobs/MyProject/modules/com.mycompany.myproject$web/builds/2011-09-27_13-32-33/archive/com.mycompany.myproject/web/1.1-SNAPSHOT/pom.xml
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Compilation failure
{{{compiler failure here}}}
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.BuildFailureException: Compilation failure
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:579)
{{{stacktrace omitted}}}
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:516)
{{{stacktrace omitted}}}
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 7 seconds
[INFO] Finished at: Tue Sep 27 13:33:42 CEST 2011 [INFO] Final Memory: 53M/508M
[INFO] ------------------------------------------------------------------------

Resources