Eclipse Luna maven-jar-plugin execution not covered by lifecycle - m2e

I have a maven java project (deploying to jboss, if that matters) that uses the maven-jar-plugin. This works fine using Eclipse Kepler. I'm now trying Luna (EE edition), and I'm now getting this error
Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-jar-plugin:2.5:jar (execution: make-a-jar, phase: compile)
in all my child .pom files (the maven-jar-plugin is specified in the parent .pom file, but the error points to the block in the child .poms).
In the .pom viewer, if I click on the error message in the Overview tab, it gives me the option to "Discover new m2e connectors". Clicking on this brings up the "m2e Marketplace" dialog and appears to do a bunch of work, but then just shows me an empty list. If I click "Finish", it tries to calculate dependencies, and then gives me this error:
Operation details
Cannot complete the request. See the error log for details.
"m2e connector for mavenarchiver pom properties" will be ignored because a newer version is already installed.
So it appears to be that maybe the maven-jar-plugin depends on a particular version of mavenarchiver, but Eclipse Luna EE comes with a newer version. Is there a way to fix this problem, or do I just have to wait for a newer version of maven-jar-plugin to be released? (I'm currently using version 2.5 of maven-jar-plugin, which is the latest that I'm aware of.)

I had a similar problem when trying to import Hadoop project in Eclipse. The solution above works... but I got "tired" of changing some of the pom files, and thought that the change would bite me later. So, another solution is:
To avoid the messages in Eclipse regarding execution not covered by lifecycle, go to Windows -> Preferences -> Maven -> Errors/Warning and select Ignore for "Plugin execution not covered for Lifecycle.."

You can solve the problem when you change the phase of execution from compile to package (which is default lifecycle phase for jar goal).
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin}</version>
<executions>
<execution>
<phase>package</phase> <!-- changed from compile to package -->
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>

Related

Not updated module version in Magnolia

What could be a reason for not updated module version in Magnolia 5.7
In Magnolia java project I have submodule with XML descriptor in META-INF/magnolia/mymodule.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module SYSTEM "module.dtd" >
<module>
<name>mymodule</name>
<displayName>mymodule</displayName>
<description>my module</description>
<version>${project.version}</version>
<!-- <version>1.3</version> -->
<dependencies>
<dependency>
<name>core</name>
<version>5.7.4/*</version>
</dependency>
</dependencies>
</module>
When I rebuild the whole project with version changed in project maven pom.xml and deploy on a server I don't see an updated version in Magnolia's Author configuration console. I have to manually remove the old version node in the configuration console (remove JCR node) and then restart the server. After these steps, I can confirm the new version in the configuration console. Which is a pain if you have to deploy to several dev/stage/prod environments needless to say that I have no access to a public instance in a production environment.
The problem with not updated version sounds like not important, but I'm also not seeing new or renamed pages associated with this module. They appear only if I force to reload module by removing version.
One additional detail which may help identify the problem: I can delete version node in JCR, but can NOT delete the whole module node. I receive an error message "Level 1 and 2 nodes in config workspace cannot be unpublished".
What version do you see in the config:/modules/your_module/version before you delete it? Is it lower than version number of version you are trying to install? I would suspect that it's same or higher. Ie you are trying to reinstall same version or downgrade the version. Neither of those is supported hence it doesn't trigger the installation process. Or perhaps you are trying to move up from SNAPSHOT to full version for which there's no install delta either.
As for the warning you get when trying to delete those nodes, it is on purpose. You are not supposed to be deleting those nodes as a normal user since you could cause breakage of dependent (public) instances. Only as admin (via JCR Browser) you are allowed to delete, assuming you know what and why you are doing.

copy-flex-resources not working in flexmojos

I am trying to copy the dependent into war using the copy- flex-resources plugin. However I'm getting the following error :
[ERROR] Failed to execute goal org.sonatype.flexmojos:flexmojos-maven-plugin:4.2-beta:copy-flex-resources (default) on project myproject: Execution default of goal org.sonatype.flexmojos:flexmojos-maven-plugin:4.2-beta:copy-flex-resources failed. NullPointerException
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
<version>4.2-beta</version>
</plugin>
I'm all over this issue, but could not find a solution.
I am sorry, but NullPointerException does not say much, try to run maven with parameters -e or -X (or both) to see more logging information to find out what is going on. Also you may try a release version of the plugin, not beta just to be sure.
And if you also provide part of the pom.xml with your plugin configuration, someone could notice some mistake :).

What Drools JARS are needed in a servet's WEB-INF\lib for jBPM?

I have ported a Tomcat servlet to run with JBoss 7.1 and am now trying to add jBPM support to it. I have run the jbpm-5.4.0.Final-installer-full.zip to get JBoss/jBPM installed with Kepler (I had to patch the installer to install Kepler). I then copied a line of code from the installer's "evaluation" sample and placed it in my servlet. That line of code is:
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
After adding the necessary imports I got a clean build. I thought that I could then take the Drools run time files I found in the installer's .\runtime\lib and place them in my servlet's .\WEB-INF\lib. However, doing this caused me to get a "Class not found" exception when I tried to execute the KnowledgeBuilder line of code. It turns out that if I replace the JARs from the installer's .\runtime\lib with the JARS in drools-distribution-5.5.0.Final.zip (from http://www.jboss.org/drools/downloads) in my .\WEB-INF\lib I am able to execute KnowledgeBuilder line of code.
My questions are:
1) Why don't the JARs from the installer's .\runtime\lib work in the above?
2) Where can I find documentation on what all of these Drools JARs do and which ones are needed?
Thank you.
Al
If I were to list specific Jars here, the answer would only apply to a specific version of Drools. The best way to get the correct JARs is to use Maven to build your project. That will automatically import all of the JARs that are needed.
You will usually need dependencies for drools-core and drools-compiler. Those have their own transitive dependencies.
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-core</artifactId>
<version>${drools.version}</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
<version>${drools.version}</version>
</dependency>
If you use Eclipse, then you can just create a pom.xml with those dependencies in it. Open it in the Maven pom editor and the "Effective POM" tab will show you all of the required dependencies.

Unable to download flexmojos plugin, maven ignores repositories config

I have Flex project and I need flexmojos-maven-plugin to build it.
<plugin>
<groupId>org.sonatype.flexmojos</groupId>
<artifactId>flexmojos-maven-plugin</artifactId>
...
</plugin>
I also mentioned repository
<repositories>
<repository>
<id>flexmojos</id>
<url>http://repository.sonatype.org/content/groups/flexgroup/</url>
</repository>
</repositories>
But maven ignores it and doesn't try to download plugin from there.
[INFO] Scanning for projects...
Downloading: http://repo1.maven.org/maven2/org/sonatype/flexmojos/flexmojos-maven-plugin/3.9/flexmojos-maven-plugin-3.9.jar
[INFO] Unable to find resource 'org.sonatype.flexmojos:flexmojos-maven-plugin:maven-plugin:3.9' in repository central (http://repo1.maven.org/maven2)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
Please, advise. Thanks!
There seems to be something wrong with the 3.9 build. I can successfully download version 3.8 without any problems. But 3.9 triggers an "unable to find resource" error.
I doubt you've had problems resolving the repositories. Sometimes the Maven output doesn't do a great job of showing its efforts it reading from remote repos. Particularly when you repeatedly run the same failing command (e.g. mvn clean install).
Take a look in your local repository. If you can find anything under org/sonatype/flexmojos then you're certainly resolving the repository correctly.
I would suggest you post this on the mailing list: https://docs.sonatype.org/display/FLEXMOJOS/Project+Information

Why is FlexMojos "unable to resolve 'assets/**/*.png' for transcoding"?

I'm trying to mavenize a Flex project using Flash Builder 4 as IDE.
I'm using flexmojos 4.0-beta-7 with flex sdk 4.5.0.19786.
In my pom.xml I have:
<build>
<sourceDirectory>${basedir}/src/main/flex</sourceDirectory>
...
</build>
and I have this directory structure ${basedir}/src/main/flex/assets/icons/**.png.
I have ${basedir}/pom.xml. I followed OpenScales fx samples as a model for my project.
FlashBuilder compiles normally, but invoking $>mvn clean package lots of unable to resolve 'assets/icons/*.png' for transcoding errors are raised.
Does assets folder have to be added explicitly for compiling? How?
Here it is my complete ${basedir}/pom.xml and here the output from $>mvn clean package.
I had the same problem a long time ago. And solved it replacing all the paths in Embed directives from 'assets/icons/food_fr.gif' to '/assets/icons/food_fr.gif'.

Resources