Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Maven Integration (M2E) » Can't access org.apache.maven classes
Can't access org.apache.maven classes [message #18813] Fri, 31 October 2008 13:08 Go to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

I'm working on a plugin (several, actually) that depends on the
m2eclipse plugins. I've declared dependency on the following in my
plugin.xml:
org.maven.ide.eclipse
org.maven.ide.components.archetype_common

The latter one contains the Archetype JAR file
(archetype-common-2.0-alpha-2.jar) and exports its packages. However, I
still can not see any of the classes in the Archetype JAR (for example,
org.apache.maven.archetype.catalog.Archetype).

It is very common practice for a plugin to expose the packages from a
JAR that it contains, so I'm not sure why this is not working. Any ideas?

Eric
Re: Can't access org.apache.maven classes [message #18837 is a reply to message #18813] Fri, 31 October 2008 15:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: igor.ifedorenko.com

I was not able to reproduce this problem using eclipse 3.4.1. Can you
please open a bug report in JIRA [1] and provide sample project that
demonstrates the problem.

[1] http://jira.codehaus.org/browse/MNGECLIPSE

Eric Rizzo wrote:
> I'm working on a plugin (several, actually) that depends on the
> m2eclipse plugins. I've declared dependency on the following in my
> plugin.xml:
> org.maven.ide.eclipse
> org.maven.ide.components.archetype_common
>
> The latter one contains the Archetype JAR file
> (archetype-common-2.0-alpha-2.jar) and exports its packages. However, I
> still can not see any of the classes in the Archetype JAR (for example,
> org.apache.maven.archetype.catalog.Archetype).
>
> It is very common practice for a plugin to expose the packages from a
> JAR that it contains, so I'm not sure why this is not working. Any ideas?
>
> Eric
Re: Can't access org.apache.maven classes [message #18860 is a reply to message #18813] Fri, 31 October 2008 15:19 Go to previous messageGo to next message
Eugene Kuleshov is currently offline Eugene KuleshovFriend
Messages: 504
Registered: July 2009
Senior Member
Eric,

The PDE does not work very well with plugins that have nested jars, so
you need to import org.maven.ide.components.* projects into your
workspace. Also note that you need to add dependency on
org.maven.ide.components.maven-embedder plugin.

I would be interested to hear what kind of features you are
implementing in your plugins and if you can help you with an additional API.

regards,
Eugene


Eric Rizzo wrote:
> I'm working on a plugin (several, actually) that depends on the
> m2eclipse plugins. I've declared dependency on the following in my
> plugin.xml:
> org.maven.ide.eclipse
> org.maven.ide.components.archetype_common
>
> The latter one contains the Archetype JAR file
> (archetype-common-2.0-alpha-2.jar) and exports its packages. However,
> I still can not see any of the classes in the Archetype JAR (for
> example, org.apache.maven.archetype.catalog.Archetype).
>
> It is very common practice for a plugin to expose the packages from a
> JAR that it contains, so I'm not sure why this is not working. Any ideas?
>
> Eric
Re: Can't access org.apache.maven classes [message #18883 is a reply to message #18837] Fri, 31 October 2008 16:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

On 10/31/2008 11:07 AM, Igor Fedorenko wrote:
> I was not able to reproduce this problem using eclipse 3.4.1. Can you
> please open a bug report in JIRA [1] and provide sample project that
> demonstrates the problem.
>
> [1] http://jira.codehaus.org/browse/MNGECLIPSE

I created http://jira.codehaus.org/browse/MNGECLIPSE-1025

Thanks,
Eric


>
> Eric Rizzo wrote:
>> I'm working on a plugin (several, actually) that depends on the
>> m2eclipse plugins. I've declared dependency on the following in my
>> plugin.xml:
>> org.maven.ide.eclipse
>> org.maven.ide.components.archetype_common
>>
>> The latter one contains the Archetype JAR file
>> (archetype-common-2.0-alpha-2.jar) and exports its packages. However,
>> I still can not see any of the classes in the Archetype JAR (for
>> example, org.apache.maven.archetype.catalog.Archetype).
>>
>> It is very common practice for a plugin to expose the packages from a
>> JAR that it contains, so I'm not sure why this is not working. Any ideas?
>>
>> Eric
Re: Can't access org.apache.maven classes [message #18906 is a reply to message #18860] Fri, 31 October 2008 16:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

On 10/31/2008 11:19 AM, Eugene Kuleshov wrote:
> Eric,
>
> The PDE does not work very well with plugins that have nested jars, so
> you need to import org.maven.ide.components.* projects into your
> workspace. Also note that you need to add dependency on
> org.maven.ide.components.maven-embedder plugin.

I actually tried depending on the maven-embedder as well as the
archetype-common plugin, without success.
JARs within plugins is a pretty standard way to include third-party JARs
(that is what the Eclipse Orbit project does, AFAIK), so I don't
understand what you mean by "PDE does not work very well with plugins
that have nested jars." Can you elaborate?

> I would be interested to hear what kind of features you are implementing
> in your plugins and if you can help you with an additional API.

That would be very good, if possible. I am actually just trying to mimic
the New Maven Project wizard page, that allows the user to select an
Archetype from the catalog(s). I was planning to just copy+paste much
of the code from
org.maven.ide.eclipse.wizards.MavenProjectWizardArchetypePag e
However, if you could make a reusable Composite out of that code that I
could just use in myown dialog, that would be really wonderful.
Basically, something like a ArchetypeSelectionComposite would be ideal.

I might be able to help out somewhat with implementing something like
that, but right now we need to get something (anything) done for an
"urgent" client, so I can't take the time to create and submit any
patches right now.

Eric


> Eric Rizzo wrote:
>> I'm working on a plugin (several, actually) that depends on the
>> m2eclipse plugins. I've declared dependency on the following in my
>> plugin.xml:
>> org.maven.ide.eclipse
>> org.maven.ide.components.archetype_common
>>
>> The latter one contains the Archetype JAR file
>> (archetype-common-2.0-alpha-2.jar) and exports its packages. However,
>> I still can not see any of the classes in the Archetype JAR (for
>> example, org.apache.maven.archetype.catalog.Archetype).
>>
>> It is very common practice for a plugin to expose the packages from a
>> JAR that it contains, so I'm not sure why this is not working. Any ideas?
>>
>> Eric
Re: Can't access org.apache.maven classes [message #18928 is a reply to message #18906] Fri, 31 October 2008 17:51 Go to previous messageGo to next message
Eugene Kuleshov is currently offline Eugene KuleshovFriend
Messages: 504
Registered: July 2009
Senior Member
Eric Rizzo wrote:
>> The PDE does not work very well with plugins that have nested jars, so
>> you need to import org.maven.ide.components.* projects into your
>> workspace. Also note that you need to add dependency on
>> org.maven.ide.components.maven-embedder plugin.
> I actually tried depending on the maven-embedder as well as the
> archetype-common plugin, without success.
> JARs within plugins is a pretty standard way to include third-party
> JARs (that is what the Eclipse Orbit project does, AFAIK), so I don't
> understand what you mean by "PDE does not work very well with plugins
> that have nested jars." Can you elaborate?
https://bugs.eclipse.org/bugs/show_bug.cgi?id=157375

As far as I know, one of the reason why Orbit bundles were created is
to get around of this PDE limitation. Unfortunately we can't use such
approach because of the Maven's own class loading, so you have to import
org.maven.ide.components.* projects into your workspace in order to
compile things in the IDE. I believe Igor can't reproduce this because
he already has m2eclipse code in his workspace. Of course it is not an
issue for the command-line build.

>> I would be interested to hear what kind of features you are implementing
>> in your plugins and if you can help you with an additional API.
> That would be very good, if possible. I am actually just trying to
> mimic the New Maven Project wizard page, that allows the user to
> select an Archetype from the catalog(s). I was planning to just
> copy+paste much of the code from
> org.maven.ide.eclipse.wizards.MavenProjectWizardArchetypePag e
> However, if you could make a reusable Composite out of that code that
> I could just use in myown dialog, that would be really wonderful.
> Basically, something like a ArchetypeSelectionComposite would be ideal.
Can you please elaborate why do you need a separate wizard if you are
using archetypes?
This wizard meant to be reusable and it also allows to plug in custom
archetype sources. Besides, you should be able to use
MavenProjectWizardArchetypePage class as is.
> I might be able to help out somewhat with implementing something like
> that, but right now we need to get something (anything) done for an
> "urgent" client, so I can't take the time to create and submit any
> patches right now.
That would be great. One thing to note is that we are heavily using
SWT designer tool for working with UI, so any refactoring of visual
components should take that into account and make sure that visual
components are still usable in SWT designer.

regards,
Eugene
Re: Can't access org.apache.maven classes [message #18950 is a reply to message #18928] Fri, 31 October 2008 19:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

On 10/31/2008 1:51 PM, Eugene Kuleshov wrote:
> Eric Rizzo wrote:
>>> The PDE does not work very well with plugins that have nested jars, so
>>> you need to import org.maven.ide.components.* projects into your
>>> workspace. Also note that you need to add dependency on
>>> org.maven.ide.components.maven-embedder plugin.
>> I actually tried depending on the maven-embedder as well as the
>> archetype-common plugin, without success.
>> JARs within plugins is a pretty standard way to include third-party
>> JARs (that is what the Eclipse Orbit project does, AFAIK), so I don't
>> understand what you mean by "PDE does not work very well with plugins
>> that have nested jars." Can you elaborate?
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=157375
>
> As far as I know, one of the reason why Orbit bundles were created is to
> get around of this PDE limitation. Unfortunately we can't use such
> approach because of the Maven's own class loading, so you have to import
> org.maven.ide.components.* projects into your workspace in order to
> compile things in the IDE. I believe Igor can't reproduce this because
> he already has m2eclipse code in his workspace. Of course it is not an
> issue for the command-line build.

I actually created an Orbit-like wrapper plugin and put the
archetype-common JAR in it and that seems to work; my plugin depends on
that wrapper plugin and can now use the Archetype classes.

Are you saying that the need to import the org.maven.ide.components.*
plugins into the workspace is only for compile-time in the IDE and that
headless build and runtime will both work correctly otherwise?
Archetype selection GUI [was: Can't access org.apache.maven classes] [message #18972 is a reply to message #18928] Fri, 31 October 2008 19:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

On 10/31/2008 1:51 PM, Eugene Kuleshov wrote:
>>> I would be interested to hear what kind of features you are implementing
>>> in your plugins and if you can help you with an additional API.
>> That would be very good, if possible. I am actually just trying to
>> mimic the New Maven Project wizard page, that allows the user to
>> select an Archetype from the catalog(s). I was planning to just
>> copy+paste much of the code from
>> org.maven.ide.eclipse.wizards.MavenProjectWizardArchetypePag e
>> However, if you could make a reusable Composite out of that code that
>> I could just use in myown dialog, that would be really wonderful.
>> Basically, something like a ArchetypeSelectionComposite would be ideal.
> Can you please elaborate why do you need a separate wizard if you are
> using archetypes?
> This wizard meant to be reusable and it also allows to plug in custom
> archetype sources. Besides, you should be able to use
> MavenProjectWizardArchetypePage class as is.

I need a simple Dialog, not a wizard. I don't think there is any way to
use a WizardPage in a regular JFace Dialog (but if there is, please let
me know).
That is why I would like to see a Composite (the WizardPage and my
dialog could both use that compsite).

Eric
Re: Archetype selection GUI [was: Can't access org.apache.maven classes] [message #18995 is a reply to message #18972] Fri, 31 October 2008 19:52 Go to previous messageGo to next message
Eugene Kuleshov is currently offline Eugene KuleshovFriend
Messages: 504
Registered: July 2009
Senior Member
Eric Rizzo wrote:
> I need a simple Dialog, not a wizard. I don't think there is any way
> to use a WizardPage in a regular JFace Dialog (but if there is, please
> let me know).
> That is why I would like to see a Composite (the WizardPage and my
> dialog could both use that compsite).
I would just use wizard with one page. Can you elaborate why you need
a dialog with such panel?

regards,
Eugene
Re: Archetype selection GUI [was: Can't access org.apache.maven classes] [message #19039 is a reply to message #18995] Mon, 03 November 2008 15:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

On 10/31/2008 3:52 PM, Eugene Kuleshov wrote:
> Eric Rizzo wrote:
>> I need a simple Dialog, not a wizard. I don't think there is any way
>> to use a WizardPage in a regular JFace Dialog (but if there is, please
>> let me know).
>> That is why I would like to see a Composite (the WizardPage and my
>> dialog could both use that compsite).
> I would just use wizard with one page. Can you elaborate why you need a
> dialog with such panel?

In this case, because it is being launched from a JFace editable table
(using an EditingSupport and a
org.eclipse.jface.viewers.DialogCellEditor. Yes, I could write a custom
CellEditor that launched a wizard dialog but my project already uses an
editable table framework that makes cell editors using our own
BaseDialog very easy and it will have to be modified to support
WizardDialog.

Is there a reason why you'd object to having a reusable Composite? For
example, what if I wanted this ability in a Forms-based editor, or on a
preferences page? A WizardPage isn't of any use in those situations but
a Composite applies equally well to all (Dialog, Wizard, form page,
preferences page, or anywhere else).

Eric
Re: Archetype selection GUI [was: Can't access org.apache.maven classes] [message #19056 is a reply to message #19039] Mon, 03 November 2008 15:39 Go to previous messageGo to next message
Eugene Kuleshov is currently offline Eugene KuleshovFriend
Messages: 504
Registered: July 2009
Senior Member
Eric Rizzo wrote:
>> I would just use wizard with one page. Can you elaborate why you need a
>> dialog with such panel?
> In this case, because it is being launched from a JFace editable table
> (using an EditingSupport and a
> org.eclipse.jface.viewers.DialogCellEditor.
Wou. I wonder what is that you are doing with that table after that.
> Yes, I could write a custom CellEditor that launched a wizard dialog
> but my project already uses an editable table framework that makes
> cell editors using our own BaseDialog very easy and it will have to be
> modified to support WizardDialog.
It is sort of chicken and an egg issue. One of us would have to
implement something. :-)
> Is there a reason why you'd object to having a reusable Composite? For
> example, what if I wanted this ability in a Forms-based editor, or on
> a preferences page? A WizardPage isn't of any use in those situations
> but a Composite applies equally well to all (Dialog, Wizard, form
> page, preferences page, or anywhere else).
Honestly, it is a pain in the butt to work with such composites
visually. But if you want to contribute patch for that, please give it a
try.

Also, I feel somewhat uneasy about those UI classes. After moving code
to Eclipse we will have to preserve the public API contracts and I was
thinking that we may have to make most of the UI classes internal. I
would say that the archetype selection UI would be the last candidate
for public API, because I can't really think of the case when one would
need it outside of the new project wizard.

regards,
Eugene
Re: Archetype selection GUI [was: Can't access org.apache.maven classes] [message #19254 is a reply to message #19056] Tue, 04 November 2008 17:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

See multiple comments in-line below...

On 11/3/2008 10:39 AM, Eugene Kuleshov wrote:
> Eric Rizzo wrote:
>>> I would just use wizard with one page. Can you elaborate why you need a
>>> dialog with such panel?
>> In this case, because it is being launched from a JFace editable table
>> (using an EditingSupport and a
>> org.eclipse.jface.viewers.DialogCellEditor.
> Wou. I wonder what is that you are doing with that table after that.

Our product is a model-driven development tool that generates web
applications and services from a DSL. For code generation, we are
leveraging Maven to create projects in the user's workspace and we have
a need to allow the user to select which archetype he wants to use for
the creation of those projects. We store the essentials (group ID,
artifact ID, and version) of the selected archetype in our model and
then use it later.
I want to leverage the existing wizard UI because it does everything I
need to do to present the user with a list of archetypes to choose from.


>> Yes, I could write a custom CellEditor that launched a wizard dialog
>> but my project already uses an editable table framework that makes
>> cell editors using our own BaseDialog very easy and it will have to be
>> modified to support WizardDialog.
> It is sort of chicken and an egg issue. One of us would have to
> implement something. :-)
>> Is there a reason why you'd object to having a reusable Composite? For
>> example, what if I wanted this ability in a Forms-based editor, or on
>> a preferences page? A WizardPage isn't of any use in those situations
>> but a Composite applies equally well to all (Dialog, Wizard, form
>> page, preferences page, or anywhere else).
> Honestly, it is a pain in the butt to work with such composites
> visually. But if you want to contribute patch for that, please give it a
> try.

I was able to use the m2eclipse wizard page class as-is in my framework,
which is great; but I still think a re-usable Composite would be nice.
I've done plenty of reusable composites using the WindowBuilder visual
designer - it's really not too bad at all as long as teh right
constructor is defined and other properties are exposed via get/set methods.
As I said, we're under time pressure right now but I'll keep it in mind
as a potential contribution.


> Also, I feel somewhat uneasy about those UI classes. After moving code
> to Eclipse we will have to preserve the public API contracts and I was
> thinking that we may have to make most of the UI classes internal. I
> would say that the archetype selection UI would be the last candidate
> for public API, because I can't really think of the case when one would
> need it outside of the new project wizard.

That would suck - and not just for this one class. We are going to be
depending pretty heavily on the m2eclipse plugins and I'm not sure at
this point how much direct code dependency we will have. How would our
organization (an Eclipse member company) become engaged in the
decision-making process about public API?

Eric
Re: Archetype selection GUI [was: Can't access org.apache.maven classes] [message #19347 is a reply to message #19254] Fri, 07 November 2008 16:18 Go to previous message
Eugene Kuleshov is currently offline Eugene KuleshovFriend
Messages: 504
Registered: July 2009
Senior Member
Eric Rizzo wrote:
> I was able to use the m2eclipse wizard page class as-is in my
> framework, which is great; but I still think a re-usable Composite
> would be nice. I've done plenty of reusable composites using the
> WindowBuilder visual designer - it's really not too bad at all as long
> as teh right constructor is defined and other properties are exposed
> via get/set methods.
> As I said, we're under time pressure right now but I'll keep it in
> mind as a potential contribution.
Please take your time. I hope to see contribution from you in the future.
>> Also, I feel somewhat uneasy about those UI classes. After moving code
>> to Eclipse we will have to preserve the public API contracts and I was
>> thinking that we may have to make most of the UI classes internal. I
>> would say that the archetype selection UI would be the last candidate
>> for public API, because I can't really think of the case when one would
>> need it outside of the new project wizard.
> That would suck - and not just for this one class. We are going to be
> depending pretty heavily on the m2eclipse plugins and I'm not sure at
> this point how much direct code dependency we will have. How would our
> organization (an Eclipse member company) become engaged in the
> decision-making process about public API?
We definitely don't want to make you upset and will try to accommodate
your requirements.
As a start I would suggest to add a wiki page and list APIs you are
using or want to have provided by m2eclipse. You just need to register
at Codehaus confluence and could add a new child page to
http://docs.codehaus.org/display/M2ECLIPSE/Other+Ideas+and+U se+Cases
We will migrate that content over Eclipse wiki after project is moved
over, so you don't need to worry about that.

regards,
Eugene
Previous Topic:creating custom project configurators for m2eclipse
Next Topic:[tycho] Product Export
Goto Forum:
  


Current Time: Thu Apr 25 21:12:20 GMT 2024

Powered by FUDForum. Page generated in 0.03558 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top