showing error like this Plug-in "org.eclipse.m2e.editor" was unable to instantiate class "org.eclipse.m2e.editor.pom.MavenPomEditor" - pom.xml

It showing error like this (Plug-in "org.eclipse.m2e.editor" was unable to instantiate class "org.eclipse.m2e.editor.pom.MavenPomEditor"). when selected POM.XML on maven project
I have try to run the maven project but not able to run it and that was happen only on maven java project not an java project. I want to run the maven project without any error so can you help me out on it.

Related

Create new module using maven

I have tried to generate a module through Maven using:
C:\Dev>mvn archetype:generate -DarchetypeCatalog=https://nexus.magnolia-cms.com/content/groups/public/
but gives me following exception:
[INFO] Generating project in Interactive mode
[WARNING] Error reading archetype catalog https://nexus.magnolia-cms.com/content/groups/public
org.apache.maven.wagon.TransferFailedException: nexus.magnolia-cms.com
Looks like you are running into https://issues.apache.org/jira/browse/ARCHETYPE-358
Try to reconfigure your repo or use attached patch for maven plugin to work around the problem.

Build a new Grails app by Gradle

I get a company's project from Github, and import into the GGTS as a gradle project. Everything runs OK. gradle task show this.
I want to create a new Grails app, so I used the command grails create-app wtf, and then import into GGTS as a Gradle project. What make me confused is that the file named build.gradle or the folder named .gradle do not appear, gradle task shows null like this, while I do the same thing in system of company and it runs fine.
Please tell me what happend? And I did not write a build.gradle in system of company manually.
The problem is Grails 2.4.4 does not use Gradle. That didn't start until Grails 3.0.
I believe you need to import the project as a Grails project (I haven't used ggts in a long time, so my recollection it's foggy). You can read more about IDE integration here.

Intellij IDEA 14 Errors with grails run-app

I upgraded to IDEA 14 (from 13) and when I attempt to run my grails 2.2.0 application, I am getting the following error:
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/gdboling/Projects/GenRocket/web/build.gradle' line: 92
* What went wrong:
A problem occurred evaluating root project 'web'.
> No such property: environment for class: org.gradle.api.internal.project.DefaultProject_Decorated
It would seem that IDEA is attempting to use my build.gradle as part of the grails build process. IDEA 13 didn't do this. I use the build.gradle for some other non-grails related tasks for the project.
If I remove the build.gradle file all together, I get this error:
FAILURE: Build failed with an exception.
* What went wrong:
Task 'grails-run-app' not found in root project 'web'.
* Try:
Run gradle tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I do see the Grails View in the IDE but when I try and do a Make, it is telling me to re-import the gradle project. So it would seem that IntelliJ think this is a gradle project. How I can tell it that is is just a grails project?
To confirm my suspicions, I've opened a grails project that did not contain a build.gradle and it works just fine.
I had faced similar issue when unknowingly kept on hit next next in hurry. So, you probably mistakenly created a gradle project as shown in screenshot.
And when you recreated the project created it as "Create project from existing source" which idea well knows as grails-app (default for idea).
See if you can reproduce the error by re-importing the project using import project form external module.

"javax.inject.Inject" is not recognized

I have a simple Gradle project.
I have the following in my build.gradle:
compile('javax.inject:javax.inject:1')
And I can see the jar in gradle cache. But in both Eclipse and IDEA I get following message
Error:(8, 20) java: package javax.inject does not exist
The really odd thing is that :build is successful, but there is an IDE message and an error when trying to "run".
I tried creating a Maven project and there I can import "#Inject" just fine.

Can the Cloud Foundry Maven Plugin Work With Multi-Module Aggregator Projects?

I have a standard multi-module maven project and I'm able to build it locally using mvn clean packagebut when I try to deploy it using $ mvn cf:update I get the following error:
[ERROR] Failed to execute goal org.cloudfoundry:cf-maven-plugin:1.0.0.M2:update (default-cli) on project <myprojectname>: An exception was caught while executing Mojo. The file or directory does not exist at '<my project directory>/target/<myprojectname>-SNAPSHOT.war'. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.cloudfoundry:cf-maven-plugin:1.0.0.M2:update
The problem is that I can't build a .war file for my parent .pom because it needs to be packaged as a pom file, or else maven will reject it. Therefore, I cannot supply the .war file cloudfoundry is looking for. Is there a setting I'm missing?
I'm currently looking into the Maven assembly plugin, but it seems like there should be a more straightforward way to push a multi-module maven project using the maven cloud foundry plugin.
Seems like your parent root either has a single parent pom file or if its a module, it only has a pom inside the target. You are not creating war file inside the target root of your project (if target even exist there). Your application is most likely having each module create their own war files inside their target folders.
At this time I don't think the cf maven plugin would support what you are looking for. could be a enhancement to add a parameter with the module that contains the war file but that is something that needs to be done!
https://github.com/cloudfoundry/vcap-java-client/blob/master/cloudfoundry-maven-plugin/src/main/java/org/cloudfoundry/maven/Update.java
I would recommend you to look into the assembly plugin (which you are already).
Let us know how it goes!

Resources