I know how to add a Maven goal to a Maven project in Eclipse. How can I add a Maven goal e.g.:
mvn install -DskipTests
for all my Maven projects in Eclipse?
Related
How to resolve my maven project dependencies in intelliJ?
I have downloaded github project which have spark scala code and build it using sbt. I am trying to import the project to below version of Scala IDE. But I do not see the option to import sbt or scala project. How can I import it?
Scala IDE build of Eclipse SDK
Build id: 4.1.0-vfinal-20150704-2326-Typesafe
Use plug-ins that can generate Eclipse project files out of the sbt project definition.
sbt 0.7.x, use eclipsify
sbt 0.12.x, use sbteclipse
Add the plugin to project/plugins.sbt file.
example: addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.4.0")
Run sbt eclipse
My dependencies issues:
My Maven Errors:
There are around 114 unresolved dependencies showing.
But I see all those dependencies jars under .m2/repositories
Could this be eclipse or maven version issue ??
Apparently project dependencies are not being packaged into the jar generated by:
sbt package
How can dependencies be included?
Well, I use sbt-assembly plugin to create jar with dependencies,
(1) add sbt-assembly to projects/assembly.sbt
echo 'addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.8")' > project/assembly.sbt
(2) run sbt clean assembly to build the jar.
It will create ${name}-assembly-${version}.jar in target/scala-${scalaVersion}
(3) Only in case you get infamous de-duplicate error, use assemblyMergeStrategy as described in here
There's a project called onejar that will package a project and all its dependencies into a single jar file. There is an SBT plugin as well:
https://github.com/sbt/sbt-onejar
However if you're just looking to create a standard package (deb, rpm, etc.) there is sbt-native-packager:
https://github.com/sbt/sbt-native-packager
It can place all your dependencies into a Linux package and add the appropriate wrappers to load all your dependencies and start your program or service.
I have created a scala project using sbt as explained in this question
Now I want to import this project into eclipse.
How can I do that?
You use a plugin such as sbteclipse to genereate the sbt project
For sbt 0.13 and up (from the above link)
Add sbteclipse to your plugin definition file. You can use either:
the global file (for version 0.13 and up) at ~/.sbt/0.13/plugins/plugins.sbt
the project-specific file at PROJECT_DIR/project/plugins.sbt
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" %
"2.5.0")
In sbt use the command eclipse to create Eclipse project files
eclipse
In Eclipse use the Import Wizard to import Existing Projects into Workspace