score:1

i automated setting up eclipse, including importing existing maven projects.

first run mvn eclipse:eclipse on the project

   mvn eclipse:eclipse:

next grab an eclipse plugin that will perform the headless import of projects into the workspace:

   wget https://github.com/snowch/test.myapp/raw/master/test.myapp_1.0.0.jar

copy the above jar to your /eclipse/dropins/ folder.

next find all the directories that can be imported into eclipse and append them with '-import'

imports=$(find . -type f -name .project)

# although it is possible to import multiple directories with one 
# invocation of the test.myapp.app, this fails if one of the imports
# was not successful.  using a for loop is slower, but more robust
for item in ${imports[*]}; 
do 
   import="$(dirname $item)/"
   echo "importing ${import}"

   # perform the import using the test.myapp_1.0.0.jar
   eclipse -nosplash \
      -application test.myapp.app \
      -data $workspace \
      -import $import
done

finally, add the m2_repo variable to the workspace

mvn eclipse:configure-workspace

Related Query

More Query from same tag