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!
Related
I would like to produce a fat/standalone jar which contains both my test classes and test-scope dependencies.
Using the maven-jar-plugin, I can create a jar which contains my test classes but it does not contain dependencies.
Reading the internet, appears the solution is to combine maven-jar-plugin with maven-assembly-plugin.
I tried following these instructions https://jitblog.net/build-maven-standalone-tests/ but have had no success.
Here is a repro of my issue: https://github.com/yanakad/commons-compress-test
Run mvn clean package
Expected: target/fatJar.jar will contain both SnakeYaml and TestClass
Observed: SnakeYaml is indeed there but TestClass is not
My maven version is Apache Maven 3.6.0
Looking at the maven execution, it seems that
`[INFO] --- maven-assembly-plugin:3.2.0:single (fat-testjar) # compress-test ---`
is run before
`[INFO] --- maven-jar-plugin:3.2.0:test-jar (default) # compress-test ---`
Not sure if that's the cause or a red herring, or how to fix...Any insight much appreciated
So it did turn out to be a silly mistake but leaving here in case it helps someone else
maven-jar-plugin and maven-assembly-plugin run in the same build phase. Maven apparently executes plugins in the lexical order of the file. So the fact that the assembly plugin was running before the jar plugin was in fact the problem.
The solution was to reorder the plugins in the pom.xml files to have maven-jar-plugin appear before maven-assembly-plugin
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"
}
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
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.
Does anybody know of any reason why some of my projects are marked as SKIPPED at the end of a successful maven build?
please note that the 'skip chain' always starts with my web project which includes the following features:
jspc-maven-plugin
war plugin with overlay
maven-dependency-plugin
It could be due to OutOfMemoryError's inside Maven. We had similar problem with Maven skipping half of the modules. Increasing memory for Maven process itself solved the issue. I don't know if it is specific to some particular plugin behaving bad or to the Maven core.