I can't create .war with maven - maven

I created a .war with maven clean install, now I need create other .war, but I get this error ->
- maven-clean-plugin:2.6.1:clean (default-clean) # tutorial---
[INFO] Deleting C:\Users\yo\eclipse-workspace\tutorial\target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.843 s
[INFO] Finished at: 2018-09-24T15:46:51+02:00
[INFO] Final Memory: 17M/228M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.6.1:clean (default-clean) on project tutorial: Failed to clean project: Failed to delete C:\Users\yo\eclipse-workspace\tutorial\target -> [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
Now My field \target is empty and I can't create .war

Some other application has opened the target folder. Due to this maven-clean-plugin is not able to delete the target folder and fails.

Related

Maven MojoExecutionException using Checkmarx on JSproject

I am using checkmarx maven plugin to perform a checkmarx scan on my javascript base project (Angular 1.6).
When I run the command mvn checkmarx:scan in output I have the error bellow.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.116 s
[INFO] Finished at: 2018-04-03T17:23:31+02:00
[INFO] Final Memory: 17M/217M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.checkmarx.maven:checkmarx-maven-plugin:8.5.0:scan (default-cli) on project gbis-wms-common-web-client: You must set at least one file.
-> [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
Any idea? thank in advance
The solution were to add a sourceDirectory> tag in the build section of my pom.xlm and it works. see bellow :
<build>
...
<sourceDirectory>./src</sourceDirectory>
...
</build>

Jenkins Maven integration failed

I am trying to integrate Jenkins with Maven. Through terminal I am able to execute the Maven command (clean install). But from Jenkins it fails.
Getting following error:
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f /Users/krishna/eclipse-workspace/Tools/LearnBroswserStack/pom.xml clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building BrowserStackDemo 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # BrowserStackDemo ---
[INFO] Deleting /Users/krishna/eclipse-workspace/Tools/LearnBroswserStack/target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.090 s
[INFO] Finished at: 2018-02-04T16:17:27+01:00
[INFO] Final Memory: 11M/190M
[INFO] ------------------------------------------------------------------------
**[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project BrowserStackDemo:** Failed to clean project: Failed to delete /Users/krishna/eclipse-workspace/Tools/LearnBroswserStack/target/.DS_Store -> [Help 1]
[ERROR]
[JENKINS] Archiving /Users/krishna/eclipse-workspace/Tools/LearnBroswserStack/pom.xml to BrowserStack/BrowserStackDemo/0.0.1-SNAPSHOT/BrowserStackDemo-0.0.1-SNAPSHOT.pom
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
/Users/krishna/eclipse-workspace/Tools/LearnBroswserStack/pom.xml is not inside /Users/Shared/Jenkins/Home/workspace/MavenJenkinsIntegration1/Users/krishna/eclipse-workspace/Tools/LearnBroswserStack/; will archive in a separate pass
[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
channel stopped
Finished: FAILURE
Note:
I am not using any server like Tomcat. My problem is not able to delete the target folder from Jenkins, when ever I taken a clean build, target folder will create newly, so I am unable to give the access for the target folder.
Your Jenkins executor is unable to delete the target folder of project . The error statements points it out clearly.
*[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project BrowserStackDemo:** Failed to clean project: Failed to delete /Users/krishna/eclipse-workspace/Tools/LearnBroswserStack/target/.DS_Store -> [Help 1]
Such error occurs when the access to file is denied at the OS filesystem level OR the target folder's files are already being used somewhere in some other process and they are left in OPEN state. Try deleting the target folder manually.

Every build fails in maven

C:\Users\saurabh_kumar>cd C:\Users\saurabh_kumar\Desktop\github\MoviePoll\MoviePoll
C:\Users\saurabh_kumar\Desktop\github\MoviePoll\MoviePoll>mvn clean
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building MoviePoll 1.0.0-BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin
/2.5/maven-clean-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.593 s
[INFO] Finished at: 2015-12-29T18:39:11+05:30
[INFO] Final Memory: 14M/89M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies cou
ld not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-cle
an-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:po
m:2.5 from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.Validato
rException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderExcep
tion: unable to find valid certification path to requested target -> [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 followi
ng articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
C:\Users\saurabh_kumar\Desktop\github\MoviePoll\MoviePoll>
i am trying to build a java application ,but i am getting this error not with this but with every build.I found few solutions like deleting everything in .m2 folder but that also couldn't resolve this issue.
You haven't set up Maven to use SSL. Either switch to http:// (instead of https://), or have a look at this page. You need to import the certificates and then set up your MAVEN_OPTS accordingly.

Install Maven jar with pom into local repository

I have an old jar (jsf-api-2.0.2.jar). In this jar there is a /META-INF/maven-Folder.
How do I install the jar into my local repository?
install:install-file says I need to specify the artifactId myself. How do I force it to use the information in jsf-api-2.0.2.jar!\META-INF\maven\com.sun.faces\jsf-api\pom.xml?
Output:
mvn install:install-file -Dfile=jsf-api-2.0.2.jar
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.4:install-file (default-cli) # standalone-pom ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.410s
[INFO] Finished at: Sat Feb 01 12:52:34 CET 2014
[INFO] Final Memory: 13M/368M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4:install-file (default cli) on project standalone-pom: The artifact information is incomplete or not valid:
[ERROR] [0] 'groupId' is missing.
[ERROR] [1] 'artifactId' is missing.
[ERROR] [2] 'packaging' is missing.
[ERROR] [3] 'version' is missing.
[ERROR] -> [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
See http://maven.apache.org/plugins/maven-install-plugin/examples/custom-pom-installation.html
Just ensure you're using at least version 2.5, which introduced this feature.
And by the way: the goal is install-file, not install-jar

Maven - issue running mvn help:effective-pom

I am working through a basic Maven tutorial, and managed to create a simple archetype and run a mvn install. However, when trying to do a mvn help:effective-pom, I just seem to get this output:
mvn help:effective-pom [INFO] Scanning for projects... [INFO]
[INFO]
------------------------------------------------------------------------ [INFO] Building simple 1.0-SNAPSHOT [INFO]
------------------------------------------------------------------------ [INFO] [INFO] --- maven-help-plugin:2.2:effective-pom (default-cli) #
simple --- Downloading:
http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-parameter-documenter/2.2.1/maven-plugin-parameter-documenter-2.2.1.pom
Downloading:
http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-parameter-documenter/2.2.1/maven-plugin-parameter-documenter-2.2.1.pom
[INFO]
------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO]
------------------------------------------------------------------------ [INFO] Total time: 0.925s [INFO] Finished at: Mon May 13 21:41:09 BST
2013 [INFO] Final Memory: 9M/131M [INFO]
------------------------------------------------------------------------ [ERROR] Failed to execute goal
org.apache.maven.plugins:maven-help-plugin:2.2:effective-pom
(default-cli) on project simple: Execution default-cli of goal
org.apache.maven.plugins:maven-help-plugin:2.2:effective-pom failed:
Plugin org.apache.maven.plugins:maven-help-plugin:2.2 or one of its
dependencies could not be resolved: Failed to collect dependencies for
org.apache.maven.plugins:maven-help-plugin:jar:2.2 (): Failed to read
artifact descriptor for
org.apache.maven:maven-plugin-parameter-documenter:jar:2.2.1: Could
not transfer artifact
org.apache.maven:maven-plugin-parameter-documenter:pom:2.2.1 from/to
central (http://repo1.maven.org/maven2): Access denied to:
http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-parameter-documenter/2.2.1/maven-plugin-parameter-documenter-2.2.1.pom
-> [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
not much hope for me if I cant get past "Hello World" example...any advice appreciated.
Regards
i
One of your network components blocks access to http://repo1.maven.org/maven2/org/apache/maven/maven-plugin-parameter-documenter/2.2.1/maven-plugin-parameter-documenter-2.2.1.pom, that's all.

Resources