Hi, I had a maven project ,while trying to maven clean i am getting the following error,anyone help me - maven-2

this is the error what i am getting ,war is generating but throwing error while trying to maven clean
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean) on project ins-model: Failed to clean project: Failed to delete D:\VEMASVNINSURANCEWS\AIG\ins-parent\ins-model\target\surefire-reports -> [Help 1]
Failed to execute goal-clean-plugin:2.4.1:clean (default-clean) on project ins-model: Failed to clean project: Failed to delete ins-parent\ins-model\target\surefire-reports
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:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
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: Failed to clean project: Failed to delete D:\VEMASVNINSURANCEWS\AIG\ins-parent\ins-model\target\surefire-reports
at org.apache.maven.plugin.clean.CleanMojo.execute(CleanMojo.java:188)
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: java.io.IOException: Failed to delete
[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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] <goals> :ins-model
this is the error what i am getting ,war is generating but throwing error while trying to maven clean

You are on Windows and you cannot delete the target folder (that's basically what mvn cleandoes) if any program is currently having a lock on something inside target.
According to your logs, that's the folder surefeire-report which is locked so: either your previous build is not finished and you have a Java thread still locking that folder or your have it opened in a console/browser.

Some other process is using (parts of) the directory affected by clean (target). Some of the possible offenders:
An application launched from the IDE earlier and still running.
A directory nested within the parent directory (target) is opened in a file manager, it may lock parts of the content to be cleaned.

Related

Maven build fails to instrument classes

I am getting the following error when running a maven build. Seems to not be able to instrument classes. Anyone has an idea what should be the cause?
Thanks.
Here is build output:
[ERROR] Failed to execute goal org.javalite:activejdbc-instrumentation:1.4.11:instrument (default) on project xtm2rest: Failed to add output directory to classpath: org.javalite.instrumentation.InstrumentationException: javassist.NotFoundException: modelClass(..) is not found in org.javalite.activejdbc.Model -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.javalite:activejdbc-instrumentation:1.4.11:instrument (default) on project xtm2rest: Failed to add output directory to classpath
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
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:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
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.apache.maven.plugin.MojoExecutionException: Failed to add output directory to classpath
at org.javalite.instrumentation.ActiveJdbcInstrumentationPlugin.execute(ActiveJdbcInstrumentationPlugin.java:88)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.lang.RuntimeException: org.javalite.instrumentation.InstrumentationException: javassist.NotFoundException: modelClass(..) is not found in org.javalite.activejdbc.Model
at org.javalite.instrumentation.Instrumentation.instrument(Instrumentation.java:70)
at org.javalite.instrumentation.ActiveJdbcInstrumentationPlugin.instrument(ActiveJdbcInstrumentationPlugin.java:124)
at org.javalite.instrumentation.ActiveJdbcInstrumentationPlugin.execute(ActiveJdbcInstrumentationPlugin.java:82)
... 21 more
Caused by: org.javalite.instrumentation.InstrumentationException: javassist.NotFoundException: modelClass(..) is not found in org.javalite.activejdbc.Model
at org.javalite.instrumentation.ModelInstrumentation.instrument(ModelInstrumentation.java:43)
at org.javalite.instrumentation.Instrumentation.instrument(Instrumentation.java:57)
... 23 more
Caused by: javassist.NotFoundException: modelClass(..) is not found in org.javalite.activejdbc.Model
at javassist.CtClassType.getDeclaredMethod(CtClassType.java:1210)
at org.javalite.instrumentation.ModelInstrumentation.doInstrument(ModelInstrumentation.java:51)
at org.javalite.instrumentation.ModelInstrumentation.instrument(ModelInstrumentation.java:40)
... 24 more
Since you are not adding any more information, I can only speculate that your version of activejdbc-instrumentation plugin and activejdbc are different. Check that both are on the same version.

Error while building Jboss developer studio 9.1.0 Beta 2 from source

I have downloaded jboss-devstudio-9.1.0.Beta2-src.zip and am building it from source.
However, the build is failing with the following error:
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-packaging-plugin:0.24.0:package-plugin (default-package-plugin) on project com.jboss.devstudio.core: Execution default-package-plugin of goal org.eclipse.tycho:tycho-packaging-plugin:0.24.0:package-plugin failed: One of setGitDir or setWorkTree must be called. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.tycho:tycho-packaging-plugin:0.24.0:package-plugin (default-package-plugin) on project com.jboss.devstudio.core: Execution default-package-plugin of goal org.eclipse.tycho:tycho-packaging-plugin:0.24.0:package-plugin failed: One of setGitDir or setWorkTree must be called.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
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:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
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:606)
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.apache.maven.plugin.PluginExecutionException: Execution default-package-plugin of goal org.eclipse.tycho:tycho-packaging-plugin:0.24.0:package-plugin failed: One of setGitDir or setWorkTree must be called.
So it is looking for a git repository in the directory, but I have downloaded source code zip.
Any ideas how I can resolve this error and proceed with the build?
This issue was fixed: https://issues.jboss.org/browse/JBDS-3598
Note that as of devstudio 10.x, sources are public so you can just fetch the latest from github and build from that.
https://github.com/jbdevstudio/jbdevstudio-product
Or for a specific release, you can download a zip of sources:
https://github.com/jbdevstudio/jbdevstudio-product/releases/tag/jbdevstudio-10.1.0.GA

"mfp push" throws NullPointerException while deploying adapter (MobileFirst Platform 7.1)

using MobileFirst Platform CLI version 7.1.0.00.20151227-1730 I have suddenly the following error when trying to push an update I made to an adapter:
Preparing for push...
Verifying Server Configuration...
Runtime 'localMFP' will be used to push the project into.
[Error:
BUILD FAILED
/Applications/IBM/MobileFirst-CLI/mobilefirst-cli/node_modules/generator-worklight-server/lib/build.xml:497: com.worklight.upgrader.UpgradeEngineException: java.lang.NullPointerException
at com.worklight.upgrader.WLUpgradeEngine.<init>(WLUpgradeEngine.java:142)
at com.worklight.upgrader.WLUpgradeEngine.<init>(WLUpgradeEngine.java:147)
at com.worklight.upgrader.ant.UpgraderTask.execute(UpgraderTask.java:100)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.lang.NullPointerException
at java.text.MessageFormat.applyPattern(MessageFormat.java:436)
at java.text.MessageFormat.<init>(MessageFormat.java:362)
at java.text.MessageFormat.format(MessageFormat.java:840)
at com.worklight.upgrader.WLUpgradeEngine.findProjectVersion(WLUpgradeEngine.java:602)
at com.worklight.upgrader.WLUpgradeEngine.<init>(WLUpgradeEngine.java:133)
... 18 more
Total time: 3 seconds
]
Error: Sorry an error has occurred. Please check the stack above for details.
I have tried to cleanup the project, remove what was already deployed, revert my changes to what I had when I succeeded to deploy, re-install mfp cli, but I still have the issue.
Any hint on what I could do to get rid of the exception?
Thanks!
The failure is coming from the upgrader code path, as if something is missing in the adapter files.
My suggestion is to create a new adapter and see that it gets deployed. Then, start adding back code. Maybe you will find the failing part.

Enunciate not able to assemble a jersey based REST API to upload a file: No more than one JAX-RS entity parameter is allowed

I have a resource like this. Enunciate has problem documenting this resource: "No more than one JAX-RS entity parameter is allowed (all other parameters must be annotated with one of the JAX-RS resource parameter annotations)".
#POST
#Path("{appId}/versions/{id}/upload")
#Consumes(MediaType.MULTIPART_FORM_DATA)
public Response upload(#PathParam("appId") Long appId,
#PathParam("id") Long id,
#FormDataParam("file") InputStream uploadedInputStream,
#FormDataParam("file") FormDataContentDisposition fileDetail)
throws Exception;
I found a similar issue reported
http://markmail.org/message/vgvi3cljo3a2f6eh
http://jira.codehaus.org/browse/ENUNCIATE-537
and this was fixed in version 1.23.
I'm using the latest version 1.26.2 but still seeing this error.
When I annotate with org.codehaus.enunciate.XmlTransient I'm able to avoid this error, but this removes documentation for the whole resource (all methods).
Any help would be great.
Maven Error stack:
[WARNING] Validation result has errors.
error: [core] AppResource.upload: No more than one JAX-RS entity parameter is allowed (all other parameters must be annotated with one of the JAX-RS resource parameter annotations).
1 error
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.640s
[INFO] Finished at: Tue May 28 14:48:18 IST 2013
[INFO] Final Memory: 20M/50M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.enunciate:maven-enunciate-plugin:1.26.2:assemble (default) on project crashreport-ws: Problem assembling the enunciate app. org.codehaus.enunciate.apt.ModelValidationException: There were validation errors -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.enunciate:maven-enunciate-plugin:1.26.2:assemble (default) on project crashreport-ws: Problem assembling the enunciate app.
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: Problem assembling the enunciate app.
at org.codehaus.enunciate.AssembleMojo.execute(AssembleMojo.java:75)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
I'm not getting the same error. Maybe you could try using Enunciate 1.27?
Updating...
New schema location is: http://enunciate.webcohesion.com/schemas/enunciate-1.27.xsd
Regards.

Maven Unable to use archetype:generate if local repository of is changed from .m2

I am facing a strange issue. I have edited Maven settings.xml file in M2_HOME/conf and want the jars to get download to a place other than {users.home}/.m2.
I have pasted <localRepository>G:/m2Repo</localRepository> into settings.xml.
Now when I type mvn archetype:generate, I get following error:
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exist or no valid version could be found
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exist or no valid version could be found
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1851)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds(DefaultLifecycleExecutor.java:462)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:175)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
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.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.version.PluginVersionNotFoundException: The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exist or no valid version could be found
at org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.java:229)
at org.apache.maven.plugin.version.DefaultPluginVersionManager.resolvePluginVersion(DefaultPluginVersionManager.java:91)
at org.apache.maven.plugin.DefaultPluginManager.verifyPlugin(DefaultPluginManager.java:179)
at org.apache.maven.plugin.DefaultPluginManager.loadPluginDescriptor(DefaultPluginManager.java:1642)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1540)
... 15 more
[INFO] ------------------------------------------------------------------------
What could be the problem?
This can happen if the artifact or metadata got corrupted. Try to clean out your local repo by deleting all versions of the maven-archetype-plugin (including metadata and pom files).
Then execute archetype:generate again.
The issue was resolved by removing the entry for localRepository in settings.xml .
Starting to generate the archetype again
Move the downloaded artifacts the place where we wanted G:/m2Repo
start generating the artifact again.
Now the jars etc would get downloaded to the new place automatically
The problem which I can think is that I had deleted the {users.home}/.m2 folder also and
that was preventing the download .
I had a similar issue.
Environment:
`OS`: Mac Seirra 10.12.6.
`Java version` :1.8.0_144
`Maven` 3.5.4
Solution :
rm -rf ~/.m2/repository/org/apache/maven/plugins/maven-archetype-plugin/
My error was:
(http://mirrors.ibiblio.org/pub/mirrors/maven2):
Plugin not found in any plugin repository
Solution :
1. go to .m2 folder > repository
2. delete all folders inside this
3. try the following command again:
mvn archetype:generate