[ 
https://issues.apache.org/jira/browse/UIMA-2560?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13629078#comment-13629078
 ] 

Marshall Schor commented on UIMA-2560:
--------------------------------------

A workaround (that Peter might have already discovered), plus a possible 
explanation to the incident where the mismatch between the uimaj-ep-runtime's 
embedded JAR names didn't quite match the entries in the MANIFEST.MF.

First, the workaround:  As has been previously noticed, launching an Eclipse 
Application from within Eclipse fails with m2e for the xxx-runtime plugins, 
because the Eclipse builds for these only have the manifest, no JARs or 
target/classes for the collection of other projects these are trying to collect.

To work around this, for just the xxx-runtime projects, you can run mvn 
package, and produce the JAR (which, after the fixes in UIMA-2560, no longer 
copy **and unpack** the other project's JARs, they just copy the entire JAR. 

Now, for the explanation of why this sometimes works and sometimes doesn't, due 
to a name mismatch between the MANIFEST.MF's classpath and the actual copied 
JARs.  The JARs are copied using Maven's copy dependendencies.  This uses a 
Maven coordinate to get the JAR. The actual Jar then comes from your .m2 
repository, or if not there, from a Snapshot Repository, or MavenCentral, etc.  

In this case, what we're looking for is a Jar named xxx-SNAPSHOT.  According to 
Maven conventions, this could be satisfied either with an exact match, or, if 
the Jar is coming from a Snapshot repository, with a match where the JAR name 
is something like: uimaj-core-2.4.1-20130410.174534-50.jar.  

In my first try (which failed), the MANIFEST.MF had a classpath with names like 
uimaj-core-2.4.1-SNAPSHOT, and the copied jar file was 
uimaj-core-2.4.1-20130410.174534-50.jar.  So, of course, the classes couldn't 
be found.

The fix was to run mvn install on each of the included projects, which put into 
my .m2 repository files with the name
uimaj-core-2.4.1-SNAPSHOT, etc.

Now, running the mvn package on uimaj-ep-runtime ran the step to copy these 
artifacts, and Maven's artifact resolution for SNAPSHOTs found the ones with 
names ending in -SNAPSHOT.  With this, my classpath in the MANIFEST.MF and the 
actual copied names, matched.

To run, I did two things.  In the "hosting" Eclipse, I put in the "dropins" 
directory the uimaj-ep-runtime-2.4.1-SNAPSHOT.jar, and then restarted the 
hosting Eclipse.  Next, in my run configuration for the launcher for the 
Eclipse Application, in the "plugins" tab, I changed the pull-down to "Launch 
with plug-ins selected below only", and then in the top section (Workspace) of 
the selection of plugins, I uncheck the runtime plugin, and in the bottom 
section (Target Platform) I check the runtime plugin (coming from the dropin). 

This selection is saved, so you only need to do it once, or when you want to 
change something.

With this, my launched Eclipse was able to run the CDE with no problems :-). 
                
> Eclipse m2e complains about unmapped maven plugins
> --------------------------------------------------
>
>                 Key: UIMA-2560
>                 URL: https://issues.apache.org/jira/browse/UIMA-2560
>             Project: UIMA
>          Issue Type: Bug
>          Components: Build, Packaging and Test
>    Affects Versions: parent-pom-4
>            Reporter: Richard Eckart de Castilho
>            Assignee: Richard Eckart de Castilho
>             Fix For: parent-pom-5
>
>
> Recent versions of Eclipse m2e complain about Maven plugins in the UIMA 
> master pom not being covered by m2e lifecycle plugins:
> * uima-build-helper-maven-plugin
> * maven-dependency-plugin
> Add m2e metadata to the master POM to handle these.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to