Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-users] m2e plugin 1.0 bug


Hi,

I am attaching a sample project for that bug. I've included a copy in the Bug 384660 itself.
When I do a Run As>maven install on the dependent project, the tree under the jar of the dependent project shows : com>company>..
but when I have the dependent project opened and run a mvn install or even use the update dependency, it shows : WEB-INF/classes/com/company>...
Since I am not using any of the config file or dependent classes in the war project, tomcat runs fine.
Let me know if you need me to put some code in there

I've only tried with the war packaging, as this is the one that I am working on.



thank you,

Shalini




On Mon, Jul 9, 2012 at 1:27 PM, Shalini Bhandari <shalini.bhandari@xxxxxxxxx> wrote:
Hi Igor,

The project has too many internal dependencies that are not needed for debug so I'll try to create a simple one that does reproduce the bug asap.
I just opened a bug for it since i couldn't find one Bug 384660.
I'll also attach the sample project to it.


Thanks,

Shalini


On Mon, Jul 9, 2012 at 12:51 PM, Igor Fedorenko <igor@xxxxxxxxxxxxxx> wrote:
Are you able to provide a small standalone example project that
demonstrates the problem?

Does the project have to have packaging=war or the problem can be
reproduced with other packaging types?

--
Regards,
Igor


On 12-07-09 9:15 PM, Shalini Bhandari wrote:
forgot to attache fig 2




On Mon, Jul 9, 2012 at 11:01 AM, Shalini Bhandari
<shalini.bhandari@xxxxxxxxx <mailto:shalini.bhandari@gmail.com>> wrote:

    <mailto:m2e-users@xxxxxxxxxxx>Hello!



    I have issues related to Workspace Resolution enabled in Eclipse.
    Hope someone can help.

    If I understand correctly, workspace resolution enabled means
    projects don't have to be installed in the local repository to
    relate to one another.



    _Test Environment_


    Eclipse Indigo (3.7.2)

    Eclipse IDE 1.4.2

    M2e Maven Integration for Eclipse 1.0.200

    M2e Connector for build-helper-maven-plugin 0.14.0

    Maven Integration for WTP 0.15.2


    _Issue Description_


    You can configure an eclipse project to resolve dependencies from a
    workspace. This has the effect of altering the way that Maven
    locates dependency artifacts. If a project is configured to resolve
    dependencies from the workspace, these artifacts do not need to be
    present in your local repository. Assume that project1 and project2
    are both in the same Eclipse workspace, and that project1 (ex, a war
    project) depends on project2. If workspace resolution is disabled,
    the m2eclipse Maven build for project1 will only succeed if
    project2's artifact is present in the local repository. If workspace
    resolution is enabled, m2eclipse will resolve the dependency via the
    eclipse workspace. In other words, when workspace resolution is
    enabled, projects don't have to be installed in the local repository
    to relate to one another.

    But for the later, that’s not the case.

    [NB1:

    For transitive dependencies (e.g project1 depends on both project2
    and project3, and project2 depends on project3) make sure that
    ‘workspace resolution’ is enabled for all projects inside the
    workspace, else we get unpredictable results:
    http://jira.codehaus.org/browse/MECLIPSE-348

    ]

    [NB2:

    Extract from
    http://www.theserverside.com/news/1363817/Introduction-to-m2eclipse

    ]


    Now let’s perform the following set of commands through the eclipse
    IDE to test what mentioned above

     1. Workspace Resolution Enabled (cases 2 and 4) or not (cases 1 and

        3) on all related projects (fig 1.1)
     2. ‘Run As > Maven Clean’ on project1 and project2
     3. Remove projects from your local Tomcat wtpwebapps and from local
        maven.repo
     4. ‘Maven > update dependencies…’ on project1
     5. Refresh on project1
     6. Right click on your Tomcat server instance in Eclipse and do

        ‘clean tomcat work directory’ and then ‘clean’. The later should
        republish your resources as well.
     7. Start Tomcat


    Results obtained are given below.

        Workspace Resolution OFF        Workspace Resolution ON

    Project1 opened

    Project2 closed

        (1) OK  (2) OK

    Project1 opened

    Project2 opened

       

    (3) NO

    And publish to Tomcat doesn’t work

       

    (4) NO

    But publish to Tomcat works fine

    Fig 1.1

    OK: successful deployment of war to tomcat and application runs
    normally

    NO: build errors

    The key thing here is that case (4) should have started normally but
    fails at step 6.

    When we compare the directory structures of case (1) and (4), we
    notice that it’s all messed up and that all ‘.class’ files are
    missing, which is in fact normal since we didn’t do a ‘maven
    build/install/package’ of the dependent projects(fig 1.2).

    case(1) and (4) comparison

    Fig 1.2


    This is in fact an existing bug in Eclipse, but might be deprecated?

    A version downgrade/upgrade of m2e doesn’t work either. I tried to
    migrate from m2eclipse to m2e, no luck. (as done here:
    http://blog.frankel.ch/migrating-from-m2eclipse-to-m2e)


    _Bug References_     <http://stackoverflow.com/questions/2665904/m2eclipse-workspace-resolution>



    <http://stackoverflow.com/questions/2665904/m2eclipse-workspace-resolution>




    I was wondering if there are any
    solutions/workaround/recommendations to solve the bug for case 3 and
    4 mentioned above?
    Or, unless I missed it, a bug already exist for this?
    Should I open a bug onhttps://bugs.eclipse.org/
    <https://bugs.eclipse.org/> for this?
    Please help !!


    --
    Shalini






    --
    Shalini


    (408) 471-7482 <tel:%28408%29%20471-7482>




--
Shalini


(408) 471-7482



_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users


_______________________________________________
m2e-users mailing list
m2e-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-users



--
Shalini


(408) 471-7482




--
Shalini


(408) 471-7482

Attachment: Playground.zip
Description: Zip archive


Back to the top