Maven: No marketplace entries found to handle castor, antrun, and ear plugins - maven

I am importing a maven project into Eclipse. I have the m2e plugin installed and it is pointing to maven 2.2.1 on my machine.
I am getting these three errors:
No marketplace entries found to handle castor-maven-plugin:1.0:generate in Eclipse
No marketplace entries found to handle maven-antrun-plugin:1.1:run in Eclipse
No marketplace entries found to handle maven-ear-plugin:2.3.1:generate-application-xml in Eclipse
Any resources provided would be greatly appreciated.
Thanks

You can define custom build life cycle mapping for those plugins and make m2eclipse execute certain goals during Eclipse build.

This thread, https://bugs.eclipse.org/bugs/show_bug.cgi?id=350414, contains a discussion and ultimately a patch to make eclipse capable of ignoring the connectors it can't find.
Most people on the thread find the m2e's demand for custom build life cycle mapping problematic.

I faced this issue and I resolved this by enclosing the within the . Here is the example.
<build>
<pluginManagement>
<plugins>
<plugin>
....
</plugin>
</plugins>
</pluginManagement>
</build>
Reference: Link

Related

Java 11 Eclipse finds automatic module, Maven does not

I'm attempting to upgrade a 15 year old Maven multimodule project to Java 11, and the module system that was introduced in Java 9. Since the project is built using Maven, all dependencies are pretty clear. First I want to do this using the automatic module names, in order not to also introduce upgraded artifacts (if not absolutely required).
Eclipse is pretty helpful in this process, autocompleting the automatic module names in the module-info.java. For example:
requires dom4j;
But if I compile with Maven, I get errors about that it cannot find the modules Eclipse just autocompleted in there.
module-info.java:[29,18] module not found: dom4j
I am using Maven's compiler plugin 3.7.0 (3.8.0 gives a NullPointerException as per https://jira.apache.org/jira/browse/MCOMPILER-355) I suspect Maven is setting the jars up on the classpath instead of on the modulepath, but the compiler's plugin debug output does not log that.
How can I make Maven correctly handle those modules?
I was running into the same issue. Adding
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</plugin>
</plugins>
</build>
to my pom solved the problem for me...
Maven version 3.9.0 seems to be buggy and will not find the module although the dependency is using an Automatic-Module-Name. Downgrading to version 3.8.1 helps.

Why maven uses difference plugin version to build different project

I have project A and B, use Maven 2.2.1
use it to build A, the result is positive, while user it to build B, it failed.
And I found that it use plugin with different version for the two project.
I don't know why ?? The pom.xml in both A and B does not specify the version of plugin.
I just want it will use the same version of plugin to build B project as A's.
Do you have any idea about it ? Many Thanks in advance.
The first issue is that you didn't defined the version of your plugins.
Usually you should have a kind of corporate/company pom which defines all used plugins with their particular version number. By using such approach you prevent exactly such situations.
The best you can do is to define the used plugins in your pom file via pluginManagement:
<project...>
.
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-xyz-plugin</artifactId>
<version>yyyyy</version>
</plugin>
.
</plugins>
</pluginManagement>
.
</build>
.
</project>
If you do this you will get reproducible build results.
Furthermore you shouldn't use Maven 2.X anymore cause it's defined EoL.

How to configure OSGI in IntelliJ when it's handled by Maven

I'm an OSGI newb.
I can really use any guidance I can get regarding IntelliJ IDEA / OSGI / Maven / Sling.
So the actual Felix plugin dies when I load it. Apparently it hasn't been maintained and is no longer compatible with the latest release by which I mean IntelliJ IDEA 13.
So I've configured the framework to felix-framework-4.2.1, and that seems to work fine. My greatest concern is that if I apply the OSGI facet to a bundle, the settings seem to indicate that it will change the bundle. Since we have this set up in Maven, I don't think we want this. The source of the facet seems to be the Osmorc plugin. When I used it before, there were complaints about some packages in maven that weren't OSGI enabled and the IDE wanted to point to a special Spring repository for OSGI enabled jar dependencies.
Since we are doing this in Maven, should I even bother with Osmorc? Is there a better way to manage OSGI in IntelliJ IDEA? It is handy knowing which packages are OSGI enabled but an error for that? Really? Specifically I am referring to "The package is not exported by the bundle dependencies" showing up on imports and annotations.
My personal observation with Intellij IDEA 13 is that the OSGI project inspector is slightly more aggressive when it comes to profiling your classes that utilize non-osgi exported classes. That being said, a way around this is by adjusting the inspector severity level. This enables you to use the same OSGI-based approach you were using in Intellij IDEA 12.
To do this, go into your project settings (on Mac: Command+,) and then navigate to the following node:
Inspections --> OSGI --> Package accessibility
Once selected, you'll be able to change the severity level from error to warning.
Performing this change is requisite on a few changes in your pom.xml:
<dependencies>
.
.
<dependency>
<groupId>com.pkg.name</groupId>
<artifactId>some-non-osgi-artifact</artifactId>
<version>0.1-EXAMPLE</version>
</dependency>
</dependencies>
<build>
<plugins>
.
.
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>${maven-bundle-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Export-Package>
you.know.what.goes.here
</Export-Package>
<Private-Package>you.know.what.goes.here</Private-Package>
<Import-Package>
*
</Import-Package>
<Embed-Dependency>some-non-osgi-artifact;scope=compile|runtime;inline=false</Embed-Dependency>
<Embed-Transitive>true</Embed-Transitive>
<Embed-StripGroup>true</Embed-StripGroup>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
Hope this helps,
Ajay
I think your best bet currently is to use the maven bundle plugin to manage your imports and exports. This means intellij will simply see your bundles as maven projects. Still the correct jars should result. I handle OSGi bundles the same way in eclipse and it works fine.
I also read on the OSGi dev mailing list that there is a bndtools for intellij planned but this will for sure take a while.

Deploying Maven project to JBoss AS7 (standalone)

I am new to JBOSS AS7, and am strictly using MAVEN 3 via command line. I would like to deploy the *.war of my project to JBOSS AS7 without ECLIPSE. I have spent couple of days Googling and trying out difference approaches. I am able to deploy the *.war to Tomcat. I would highly appreciate any help on this. So far this is what I have done:
I have entered the server info(Jboss) to C:\maven\conf\settings.xml
I have included the plugin to the POM
I think I may be declaring the path to JBoss AS7 within my JBOSS plugin wrong.
This is how I am including the plugin in the POM file:
<plugins>
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.0.2.Final</version>
<configuration>
<url>http://localhost:8080/
<server>jboss</server>
<path>/web-app</path>
<configuration>
</plugin>
</plugins>
Did you have a look at the README on the corresponding GitHub page:
https://github.com/jbossas/jboss-as-maven-plugin
When deploying to your localhost (which is the default value) you don't need to define the <url> in the <configuration>, as well as the <server> and <path> elements (besides: I haven't seen a folder named wep-app in AS7).
We run a project where this works even without touching the settings.xml.
So when you have checked this, post what exactly goes wrong, what is the concrete failure message and what is the maven command you use (mvn jboss-as:deploy).

Anyone who actually got Tycho to work?

I'm trying to get Tycho working with m2eclipse. Problem is that all I find are outdated sites and old versions to download. I've found my way to http://github.com/sonatype/sonatype-tycho and downloaded the source. Problem is that the guide at https://docs.sonatype.org/display/TYCHO/BuildingTycho isn't of much help. When trying to build I run into an error message saying I'm using invalid syntax..... And there seems to be nowhere to ask for further guidance.
So are there anyone out there who actually got this working? Or got a better alternative for continuous integration / automatic build solution for eclipse plug-ins?
Tycho is a maven plugin, so you don't need to download it, just declare it in your pom.xml files.
See http://github.com/sonatype/sonatype-tycho/tree/master/tycho-its/projects/tycho001/ for details of a simple project.
This hint from Igor Fedorenko helped me to get it running:
https://issues.sonatype.org/browse/MNGECLIPSE-2140?focusedCommentId=115527&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_115527
If you are not pressed for time, I'd suggest to wait for the upcoming Update of m2eclipse, though. It was recently announced to follow shortly after Maven 3 release.
Robert, it does work for me as long as you don't try to build an Eclipse application. I have integrated it into CruiseControl and I am quite happy with building and testing plugins.
The main trick for me was to ignore all the P2/target stuff. I couldn't get it to work at all. Instead I call maven with an parameter that points to the Eclipse installation like this:
mvn -Dtycho.targetPlatform=C:\Programmer\eclipse
These are the necessary Plugin definitions:
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho-version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
Current Tycho Version is 0.13.0.
I would like to build Eclipse Applications but need support myself for that.
I hope that helps.
Cheers,
Klaus
I had trouble with Tycho for a while until I realized it required Maven 3. If you're running Maven 2 it won't work.

Resources