Failure in maven site plugin version 3? - maven-3

I am trying to get a project to run the maven site:site goal using Maven 3.0.4. Unbeknownst to me, it had been running under Maven 2.2.1 (when I thought it should have been 3).
I keep getting the following failure:
Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.0:site (default-cli) on project myproj-parent: Execution default-cli of goal org.apache.maven.plugins:maven-site-plugin:3.0:site failed: For artifact {null:null:null:jar}: The groupId cannot be empty.
How do I even find what artifact is missing groupId?

It turns out the POM file for one of my dependencies was corrupt. The POM for joda-jsptags-1.0.2 in our Nexus repository wasn't a POM, but a fragment of HTML.
Getting a clean version of joda-jsptags fixed this issue.
It was just frustrating not to get any sort of idea what was bad. And apparently the Maven 3 plugins are more strict on POM parsing.

If you are migrating from Maven 2.2.1 to Maven 3.0.4 you have to be aware of some difference in particular in relation with site generation. You should have taken a look the the migration docs and take a look if your pom needed to be fixed.
Missed a link.

Related

Error installing Grails plugin to local maven repository

I have created a Grails plugin using Grails 2.3.3 and trying to use the plugin in a Grails application which was also created using Grails 2.3.3. Now, to use the plugin in the application, it needs to be published to a plugin repository first. So I attempted to publish the plugin into the local repository by using the commands:
grails clean
grails compile
grails maven-install
For the grails maven-install command I selected the option 2)InstallPlugin. But then got an error:
Error installing plugin: No such property: ERROR_MESSAGE for class: Inst
allPlugin (Use --stacktrace to see the full trace)
Ran the last command above with option --stacktrace and --verbose but did not get any clue as to what the problem might be. I also removed %HOME%/.grails directory and reran the above commands and still came with the same error.
After googling, I found a JIRA for this issue which was closed stating that it happens when Grails version is changed and cleaning up cache files will get rid of this issue. However, that solution is not working for me and, by now, I have spent couple of hours trying to fix this. Also I did not change my Grails version.
Has anyone faced this issue with Grails 2.3.3 or with any recent version of Grails? What was the solution?
Don't use install-plugin, add a dependency in BuildConfig.groovy.
I don't know where the 2)InstallPlugin "option" is coming from. The maven-install script packages your plugin and generates a POM file and the other files needed to be a valid published plugins. Then it copies these files to your local M2 directory, e.g. if your plugin name is "mycoolplugin" the files are copied to $HOME/.m2/repository/org/grails/plugins/mycoolplugin
Now you can "install" the plugin as if it had been published in a remote repo. Add a dependency in the app's BuildConfig.groovy using the usual format, e.g.
plugins {
build ":tomcat:7.0.50"
compile ":scaffolding:2.0.1"
runtime ":hibernate:3.6.10.7"
...
compile ":mycoolplugin:0.1"
}

Failed to read artifact descriptor for with SpringRoo

I am very new to SpringRooSuit tool.I installed that exe 3.3 release .And I started to create the project .When building my project Its giving the error below:
Errors occurred during the build.
Errors running builder 'Maven Project Builder' on project 'HelloWorld'.
Could not calculate build plan: Plugin org.codehaus.mojo:aspectj-maven-plugin:1.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.codehaus.mojo:aspectj-maven-plugin:jar:1.4
Plugin org.codehaus.mojo:aspectj-maven-plugin:1.4 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.codehaus.mojo:aspectj-maven-plugin:jar:1.4
My first Question is Do we need to setup the Maven for this?I think maven should hace Embeeded in this exe only. I am new to Maven also.
If maven has to integrate with STS IDE how to do this...??
Please help me...
Came across this issue today so I thought I add exactly what I changed to help anyone else
Changed this from
<aspectj.version>1.7.2</aspectj.version>
to
<aspectj.version>1.7.3</aspectj.version>
and changed
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.4</version>
to
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.5</version>
Project now builds

java.lang.ClassNotFoundException: org.sonatype.aether.version.InvalidVersionSpecificationException

I am using the maven indexer to fetch the maven index from the maven central repository. Since I updated from org.sonatype.aether to org.eclipse.aether and from maven 3.0.5 to maven 3.1.0 I am getting this Exception.
Caused by: java.lang.ClassNotFoundException: org.sonatype.aether.version.InvalidVersionSpecificationException
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:244)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:230)
Maven tells me that I should check out this page: http://cwiki.apache.org/confluence/display/MAVEN/AetherClassNotFound. Did that. But on the page they just say that they are aware of this problem and they updated some maven plugins to run with maven 3.1.0. But they don't say what is the problem and how to solve it. That is not very useful.
What I have to change to make my own plugin work with maven 3.1.0 ???
I double checked my dependencies with:
mvn dependency:tree
And it seems that the old org.sonatype.aether.aether-api.jar is still in the project, which contains the Exception. So basically the org.sonatype.aether.version.InvalidVersionSpecificationException is part of my project. So why do I get this Exception ??
Use a later version of maven-dependency-plugin.
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
.... your configuration here ....
</plugin>
This error is caused by the Maven 3.1-alpha-1 migration from Sonatype Aether to Eclipse Aether, which is an incompatible change for some plugins.
To support this change, new versions of the affected plugins have been published which work both with Maven 3.0.x and 3.1.x. A list of affected plug-ins and their minimum needed version is available at https://cwiki.apache.org/confluence/display/MAVEN/AetherClassNotFound
Converting my previous comment into an answer, you can use:
mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:tree
Naturally, you can specify any version.

SAXParseException Using Maven-JAXB2 0.7.5 Plugin, Only On Maven 3

I seem to be having issues with the maven-jaxb2-plugin (Version 0.7.5) when using Maven 3. The issue doesn't occur when using Maven 2.2.x, and it only became an issue when I upgraded to Maven 3.
Following is the maven output after executing mvn clean test:
[ERROR] Error while parsing schema(s).Location
[ file:/C:/dev/smart-07-2011/mpg-money-send-service/src/main/resources/META-INF/mpg/schemas/XRSIMoneySend.xsd{218,45}].
org.xml.sax.SAXParseException: src-resolve:
Cannot resolve the name 'common:ResponseBody' to
a(n) 'type definition' component.
However, the tests execute fine when using Maven 2. I've been searching for resources online if there's any known issue between Maven 3 and JAXB2, but I couldn't find any resources. Effective POM for the build using Maven 2 or Maven 3 is identical.
Incidentally, in the past I was able to use the maven-jaxb2-plugin on Maven 3 just fine; this build, however is special in that the XSD is in a dependent JAR, so it could be a configuration issue; but I'm not sure what configuration I would need to set in the POM or bindings.
Are there any resources I could use to resolve this issue, or any resolution steps I could take? Thanks a lot!

How to build from my checkout directory ... with a twist

We're using Maven 3 with Git as our SCM system. We are using the latest version of the scm plugin (1.5). Our project is in Grails 1.2.1 (Java 1.5). The question is, how do I run a single command to generate a WAR file after doing a checkout from our repo?
This question seems complicated by the fact that we're using the a Grails project (and hence the maven-grails plugin, version 1.3.4). Grateful for any info you have, - Dave
I'm assuming that the command line below below wont work for you because of your requirement to use maven.
grails <environment> war
You can generate a pom.xml for your existing grails project with the following command. This can be a useful starting point.
mvn grails:create-pom
More documentation about grails's maven integration can be found here:
http://grails.org/doc/latest/guide/4.%20The%20Command%20Line.html#4.5%20Ant%20and%20Maven

Resources