Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2e-dev] Need help in opening m2e project in eclipse

Moin fellow listeners!


Despite doing java for quite some years, using eclipse IDE from time to time,

hacking on eclipse plugins before and providing some cleanup PRs to m2e-core I still

can't get the whole m2e project to be loaded into eclipse IDE.

I am hacking on a tool/pipeline to apply cleanups like eclipse jdt cleanups in batches

envisioning something like a continuous maintenance pipeline in the end.

But the tool needs to setup an eclipse workspace and so I must be able to load the whole project, too.

Mickael Istria suggested to join the dev mailing list and ask here, so here I am.


I am quite familiar with some inner aspects of some eclipse plugins but a rookie in a lot

of other areas.

Here is the script of a try. Any help appreciated. When making success I will open an issue

and add an updated version into it.


Thank you very much,

   Cal



Starting with vanilla eclipse jee 2021-03

export JAVA_HOME=/usr/lib/jvm/openjdk-11
PATH=${JAVA_HOME}/bin:${PATH}
git checkout -b BreakLoopEarlyCleanUp-manual origin/erefactor/master-project/1/jdt/jdt-BreakLoopEarlyCleanUp
Following https://www.eclipse.org/m2e/documentation/m2e-development-environment.html
eclipse-2021-03
New workspace: workspace-2021-03-m2e-core
Because it's jee eclipse I expect m2e and git integration to be present.
Trying to install "Logback Classic Module"
Help / Install New Software
Add "Orbit" Repository as I understand the docs:
    Orbit, https://download.eclipse.org/tools/orbit/downloads/
Error: No software site found.
Maybe:
    Orbit, https://download.eclipse.org/tools/orbit/downloads/2021-03/
Seems to work.
    Unmark "Hide items already installed"
    Select Logback Classic Module 1.2.3 ...
    Next
    Your original request has been modified.
    "Logback Classic Module" is already present because other installed software requires it.  It will be added to the installed software list.
    
    Cancel
git Submodules.
    How to check out THIS project with sub modules?
        git submodule init
        git submodule update

    
    How to make sure versions match?
        hopefully empty git status ist sufficient.

    

    
File / Import / Existing Maven Projects
    Next
    Selecting checkout dir as root directory
    Deselect all
    Select m2e-maven-runtime and all 4 sub projects
    Finish
    No error markers.
File / Import / Existing Maven Projects
    Next
    Selecting checkout dir as root directory
    "Selecting everything under m2e-core"
    Guessing that does not mean org.eclipse.m2e.core but the root pom.xml
    Let everything being included, exclude m2e-core-tests tree.
    Finish.
Eclipse is asking to "Setup Maven plugin connectors"
    
    Leave all marked.
    Finish
    Install (all)
        - m2e connector for modello
        - m2e connector for the Maven Dependency Plugin
        - Tycho Project Configurators
    Next
    Review
    Next
    Accept License
    Finish
Eclipse is "Installing Software"
Requestor: "unsigned software to be installed ..."
    Install anyway
Restart Eclipse IDE to apply the software update?
    Restart Now
Change Buildpath of 
     "org.eclipse.m2e.tests.common"
How ???
Seems the project was NOT imported as a maven project because it was not offered.
Maybe we need newer m2e?
Help / Install New Software
    Add M2E Releases, http://download.eclipse.org/technology/m2e/releases
    Select 1.15.0.... of m2e and m2e-slf4j
    Next
    Cannot complete the request.  See the error log for details.
"m2e - slf4j over logback logging (Optional)" will be ignored because a newer version is already installed. 
"m2e - Maven Integration for Eclipse (includes Incubating components)" will be ignored because a newer version is already installed. 

    
*** OK, let's ignore the buildpath of "org.eclipse.m2e.tests.common".
"Update the maven project configuration for all projects and do a clean build."
Hmm OK, let's hope that means selecting "m2e-core / Maven / Update Project"
and selecting all projects (note that "org.eclipse.m2e.tests.common" is missing from that list)
and leaving all other values default
and clicking OK.
eclipse: "Updating Maven Project"
475 Errors.
Project / Clean
    Clean all projects
    Clean
"You may need to Update Maven (forcing update of snapshot releases) and do Project/Clean…/Clean_all_projects
 to clear all compilation errors."
Hmm how to "Update Maven"?
Guess that means the system installed maven.
mvn --version
Apache Maven 3.6.0
Latest version is 3.6.3, let's try to use that.
(If maven version is so important, why not use mvn wrapper?)
wget https://downloads.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
mkdir ~/cal01/local
tar -C ~/cal01/local/ -zxvf apache-maven-3.6.3-bin.tar.gz
PATH=~/cal01/local/apache-maven-3.6.3/bin:${PATH}
mvn -version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
How to tell eclipse?
They would tell if anything is needed, yes?
Let's just exit and start eclipse again.
eclipse-2021-03
Project / Clean / Clean all
469 Errors.
Let's call that progress.
Project / Clean / Clean all
469 Errors.
Let's ask google how and if to configure maven in eclipse.
First hit: maven-in-eclipse-step-by-step-installationA
"Despite an honest effort, I have been unable to find a comprehensive tutorial on any Maven plugin. M2E, which seems like the de facto standard,
 has nothing but broken (or recursive) links on their site."
A quite old quote from that SO post but I feel it.
"After successful installation do the followings in Eclipse:
Go to Window --> Preferences
Observe, Maven is enlisted at left panel"
Let's take a look:
    No maven binary configured at that location.
m2e-core / Maven / Update Project
Project / Clean / Clean all
469 Errors.
Giving up.
...
Trying again, trying to use latest m2e plugin.
Help / Install New Software
    Add
    Adding https://download.eclipse.org/eclipse/updates/4.20-I-builds/I20210324-1800
Help / Install New Software
    Add
    Archive
    Navigate to org.eclipse.m2e.site/target/xxx.zip
    Select m2e from it
    Install
    Allow update of other componente
    next
    finish
    restart
70 errors left
m2e-core/Import
Import all suggested but exclude m2e-core-tests.
Change Buildpath of 
     "org.eclipse.m2e.tests.common"
and set "contains test sources" of sources to No..
Project / Clean / Clean all
8389 errors ...
m2e-core / Maven / Update Project
13 errors
re-building and re-adding m2e site.
    This time installing all 5 contained components.
    Install "unsigned software" "anyway".
    restart
m2e-core / Maven / Update Project
    441 errors

    
Giving up.



Back to the top