Why does building Spark sources give "object sbt is not a member of package com.typesafe"? - intellij-idea

I tried to compile the https://github.com/apache/spark project using IntelliJ IDEA with the sbt plugin on Windows.
I'm facing an error about sbt. Since I'm not familiar with sbt, I don't know how to fix it.
The error messages are as follows:
[info] Loading project definition from F:\codeReading\sbtt\spark-master\project
[info] Compiling 3 Scala sources to F:\codeReading\sbtt\spark-master\project\target\scala-2.10\sbt-0.13\classes...
[error] F:\codeReading\sbtt\spark-master\project\SparkBuild.scala:26: object sbt is not a member of package com.typesafe
[error] import com.typesafe.sbt.pom.{PomBuild, SbtPomKeys}
[error] ^
[error] F:\codeReading\sbtt\spark-master\project\SparkBuild.scala:51: not found: type PomBuild
[error] object SparkBuild extends PomBuild {
[error] ^
[error] F:\codeReading\sbtt\spark-master\project\SparkBuild.scala:118: not found: value SbtPomKeys
[error] otherResolvers <<= SbtPomKeys.mvnLocalRepository(dotM2 => Seq(Resolver.file("dotM2", dotM2))),
[error] ^
[error] F:\codeReading\sbtt\spark-master\project\SparkBuild.scala:178: value projectDefinitions is not a member of AnyRef
[error] super.projectDefinitions(baseDirectory).map { x =>
[error] ^
[error] four errors found
[error] (plugins/compile:compile) Compilation failed

Spark is built with Maven. The SBT build is only a convenience. You will have far better results importing it as a Maven project.

It looks like IDEA doesn't like project references to git projects that the Spark build definition uses for sbt-pom-reader.
It's showed up when I ran sbt within the cloned project:
➜ spark git:(master) ✗ xsbt
[info] Loading global plugins from /Users/jacek/.sbt/0.13/plugins
[info] Loading project definition from /Users/jacek/oss/spark/project/project
[info] Loading project definition from /Users/jacek/.sbt/0.13/staging/ec3aa8f39111944cc5f2/sbt-pom-reader/project
[warn] Multiple resolvers having different access mechanism configured with same name 'sbt-plugin-releases'. To avoid conflict, Remove duplicate project resolvers (`resolvers`) or rename publishing resolver (`publishTo`).
[info] Loading project definition from /Users/jacek/oss/spark/project
[info] Set current project to spark-parent (in build file:/Users/jacek/oss/spark/)
>
You can see the project reference to the git project of sbt-pom-reader when accessing the plugins project for which the reference is defined:
> reload plugins
[info] Loading global plugins from /Users/jacek/.sbt/0.13/plugins
[info] Loading project definition from /Users/jacek/oss/spark/project/project
[info] Updating {file:/Users/jacek/oss/spark/project/project/}project-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Loading project definition from /Users/jacek/.sbt/0.13/staging/ec3aa8f39111944cc5f2/sbt-pom-reader/project
[warn] Multiple resolvers having different access mechanism configured with same name 'sbt-plugin-releases'. To avoid conflict, Remove duplicate project resolvers (`resolvers`) or rename publishing resolver (`publishTo`).
[info] Updating {file:/Users/jacek/.sbt/0.13/staging/ec3aa8f39111944cc5f2/sbt-pom-reader/project/}sbt-pom-reader-build...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] Done updating.
[info] Loading project definition from /Users/jacek/oss/spark/project
> projects
[info] In file:/Users/jacek/oss/spark/project/
[info] * plugins
[info] spark-style
[info] In https://github.com/ScrapCodes/sbt-pom-reader.git
[info] sbt-pom-reader
A solution could be executing sbt gen-idea to generate the project files for IDEA. It's just a guess, though.

Related

Apache Isis build failure migrating from v1.12.2. Unknown repositories ApplicationUser,

I am migrating an Apache Isis application from version 1.12.2 and currently using the legacy addons Security, Audit, and SessionLogger. I plan on updating to the latest Isis version and using the latest Incode addons here.
When changing the Isis version to 1.13.0 it fails the build. I did not see anything in the migration notes that will fix this. The build error is unkown repository for ApplicationRole, ApplicationTenancy, ApplicationUser. The bootstrap class lists the addon modules and there are no errors using Isis 1.12.2.
(update)
I thought it possible that Isis and the Incode addons should upgrade together at some point and someone would mention it, but I wasn't sure. Then looking more into this, I noticed the Apache Isis isis-app-todoapp uses an Isis version one major release higher, as well as the Incode addons, which are also one major release higher than what I have. Any idea about this? I would like to get to the latest Isis and Incode versions.
[ERROR]
[ERROR] #DomainObject annotation on org.isisaddons.module.security.dom.role.ApplicationRole specifies unknown repository 'org.isisaddons.module.security.dom.role.ApplicationRoleRepository'
[ERROR] #DomainObject annotation on org.isisaddons.module.security.dom.tenancy.ApplicationTenancy specifies unknown repository 'org.isisaddons.module.security.dom.tenancy.ApplicationTenancyRepository'
[ERROR] #DomainObject annotation on org.isisaddons.module.security.dom.user.ApplicationUser specifies unknown repository 'org.isisaddons.module.security.dom.user.ApplicationUserRepository'
[ERROR]
[ERROR]
[INFO] calling #PreDestroy on all domain services
[INFO] shutting down
org.apache.isis.core.metamodel.specloader.SpecificationLoader#1e2fe282
[INFO] ---------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] App ................................. SUCCESS [ 0.652s]
[INFO] App DOM ............................. FAILURE [ 37.945s]
[INFO] App Fixtures ........................ SKIPPED
[INFO] App App ............................. SKIPPED
[INFO] App Webapp .......................... SKIPPED
[INFO] ---------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 40.974 s
[INFO] Finished at: 2018-05-25T09:47:05-04:00
[INFO] Final Memory: 84M/692M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.isis.tool:isis-maven-plugin:1.13.2:validate (default) on project App-dom: 3 meta-model problems found. -> [Help 1]
[ERROR]
Solved by removing a maven build-profile slash validation step, after reading similar SO question, and updating the Incode addon modules with each major Isis release. I successfully went through Apache Isis release 1.13.0, 1.14.0, 1.15.0, 1.16.2.

Multi-tenant in Broadleaf

I am new to Broadleaf. And i am trying to do multitenant in it.
I can't find any documentation in Broadleaf official site. I found one project in github about multitenancy in broadleaf.That's the link
https://github.com/BroadleafCommerce/DemoSite-MultiTenant-SingleSchema
As i build that project in maven through "mvn install", its getting build failure, below error comes as i build that project.
[INFO] Reactor Summary:
[INFO]
[INFO] ecommerce ......................................... SUCCESS [0.619s]
[INFO] core .............................................. SUCCESS [1:35.628s]
[INFO] admin ............................................. FAILURE [27.273s]
[INFO] site .............................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:03.894s
[INFO] Finished at: Mon Jun 03 10:08:01 IST 2013
[INFO] Final Memory: 12M/60M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project admin: Could not resolve dependencies for project com.mycompany:admin:war:1.0: Could not find artifact com.broadleafcommerce:broadleaf-multitenant-singleschema:jar:1.0.0-SNAPSHOT in snapshots (http://192.168.1.10:8080/artifactory/libs-snapshot) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :admin
Maybe it states that it can't find the broadleaf-multitenant-singleschema jar that define in pom.xml.
<dependency>
<groupId>com.broadleafcommerce</groupId>
<artifactId>broadleaf-multitenant-singleschema</artifactId>
<version>1.0.0-SNAPSHOT</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
I tried to find that jar manually , but I can't found that jar.
I can't figure out what's the problem is.
Is it possible to do multitenant in broadleaf ?
Is that demo is about multitenant in broadleaf ?
Thanks in advance.
Ankit
glad to hear that you are trying out Broadleaf!
As you mentioned in your comment, the Broadleaf Multitenant Singleschema module is a commercial module, not a community module. Another point: Broadleaf itself (as in the core Broadleaf framework) is all open source. There is no separate commercial version of the core Broadleaf code base. However, some of the modules that we offer are commercial. Multitenant is one of them, along with things like change sets and other 3rd-party integrations (like Braintree or Sagepay).
If you would like some additional information about the multitenant module, feel free to shoot us an email at info AT broadleafcommerce.com.
Source: being a Broadleaf employee :)

Scala: SBT Eclipse plugin fails to build Breeze from scalanlp.org

I am new to Breeze (http://www.scalanlp.org/) and Scala in general. Please help to generate
Eclipse project for Breeze with sbt. I have Eclipse plugin for sbt installed.
When I try sbt eclipse it fails with the following errors. What is
wrong?
Thanks!
> ~/Distrib/Scala/breeze-master>sbt
[info] Loading global plugins from /home/an/.sbt/plugins
[info] Loading project definition from /home/an/Distrib/Scala/breeze-
master/project
[info] Set current project to breeze (in build file:/home/an/Distrib/
Scala/breeze-master/)
> eclipse
[info] About to create Eclipse project files for your project(s).
[error] java.util.NoSuchElementException: None.get
[error] Use 'last' for the full log.
> last
...
...
[debug] Project dependencies for configuration 'compile':
Success(List(breeze-math))
[debug] Project dependencies for configuration 'test': Success(List())
java.util.NoSuchElementException: None.get
at scala.None$.get(Option.scala:274)
at scala.None$.get(Option.scala:272)
at com.typesafe.sbteclipse.core.Eclipse$.relativize(Eclipse.scala:
498)
at com.typesafe.sbteclipse.core.Eclipse$$anonfun$srcEntry
$1.apply(Eclipse.scala:252)
at com.typesafe.sbteclipse.core.Eclipse$$anonfun$srcEntry
$1.apply(Eclipse.scala:249)
at scalaz.effects.IO$$anon$3$$anonfun$pure$1$$anonfun$apply
$23.apply(IO.scala:118)
at scalaz.effects.IO$$anon$3$$anonfun$pure$1$$anonfun$apply
$23.apply(IO.scala:118)
at scalaz.FreeFunctions$$anonfun$return_$1.apply(Free.scala:181)
at scalaz.FreeFunctions$$anonfun$return_$1.apply(Free.scala:181)
at scalaz.Pure$$anon$19$$anon$2.apply(Pure.scala:76)
at scalaz.Functor$$anon$15$$anon$45.apply(Functor.scala:84)
at scalaz.Free$class.go$1(Free.scala:73)
at scalaz.Free$class.run(Free.scala:76)
at scalaz.Free$Gosub.run(Free.scala:18)
at scalaz.effects.IO$class.unsafePerformIO(IO.scala:13)
at scalaz.effects.IO$$anon$2.unsafePerformIO(IO.scala:113)
at com.typesafe.sbteclipse.core.Eclipse$.onSuccess(Eclipse.scala:149)
at com.typesafe.sbteclipse.core.Eclipse$$anonfun$action
$4.apply(Eclipse.scala:105)
at com.typesafe.sbteclipse.core.Eclipse$$anonfun$action
$4.apply(Eclipse.scala:105)
at scalaz.Validation$class.fold(Validation.scala:7)
at scalaz.Success.fold(Validation.scala:82)
at com.typesafe.sbteclipse.core.Eclipse$.action(Eclipse.scala:105)
at com.typesafe.sbteclipse.core.Eclipse$$anonfun$eclipseCommand
$2.apply(Eclipse.scala:81)
at com.typesafe.sbteclipse.core.Eclipse$$anonfun$eclipseCommand
$2.apply(Eclipse.scala:81)
at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply
$2.apply(Command.scala:60)
at sbt.Command$$anonfun$applyEffect$1$$anonfun$apply
$2.apply(Command.scala:60)
at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply
$3.apply(Command.scala:62)
at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply
$3.apply(Command.scala:62)
at sbt.Command$.process(Command.scala:90)
at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(MainLoop.scala:
71)
at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(MainLoop.scala:
71)
at sbt.State$$anon$2.process(State.scala:170)
at sbt.MainLoop$$anonfun$next$1.apply(MainLoop.scala:71)
at sbt.MainLoop$$anonfun$next$1.apply(MainLoop.scala:71)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.MainLoop$.next(MainLoop.scala:71)
at sbt.MainLoop$.run(MainLoop.scala:64)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:53)
at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(MainLoop.scala:50)
at sbt.Using.apply(Using.scala:25)
at sbt.MainLoop$.runWithNewLog(MainLoop.scala:50)
at sbt.MainLoop$.runAndClearLast(MainLoop.scala:33)
at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:17)
at sbt.MainLoop$.runLogged(MainLoop.scala:13)
at sbt.xMain.run(Main.scala:26)
at xsbt.boot.Launch$.run(Launch.scala:55)
at xsbt.boot.Launch$$anonfun$explicit$1.apply(Launch.scala:45)
at xsbt.boot.Launch$.launch(Launch.scala:69)
at xsbt.boot.Launch$.apply(Launch.scala:16)
at xsbt.boot.Boot$.runImpl(Boot.scala:31)
at xsbt.boot.Boot$.main(Boot.scala:20)
at xsbt.boot.Boot.main(Boot.scala)
[error] java.util.NoSuchElementException: None.get
[error] Use 'last' for the full log.
>
This is a known bug in sbteclipse: https://github.com/typesafehub/sbteclipse/issues/128
You can try commenting out the "doc" project in the Project.scala definition and see if that helps. Otherwise, I think this is a bug in sbteclipse that has to get resolved first.

Error While Test The Project On Maven

i am using maven i don't have more knowledge about maven when i am install my project then it will successfully build but when i am test my project with maven it will give me an error like
Unable to copy an artifact to the working directory
i gave all permission to my project directory detail error as below so how can i resolve my
problem and how to run my project
so please help me
E
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 24 seconds
[INFO] Finished at: Thu Jan 27 17:44:59 IST 2011
[INFO] Final Memory: 35M/84M
[INFO] ------------------------------------------------------------------------
[INFO] Unable to copy an artifact to
the working directory Embedded error:
/home/nayan/workspace/ONiT/mediaPlayer/target/classes
(Is a directory) [INFO]
This looks like some of the previous tests are still running at this point and blocking maven from writing in the target directory.
As this seems to be an reactor build, do the modules themself build correctly ? I.e. can you run mvn test in each module directory seperately ?

Nexus repository contains artifact but only makes POM available

I have a Nexus instance with Maven 2 repositories hosted on a non-Internet-connected corporate development domain. I need to use the maven-jaxb-schemagen plugin from Sun, however, it was only available in Maven 1 format (along with many other Maven 1 dependencies, so this is not a one-off edge case).
I made a new Maven 1 hosted repository in Nexus (maven1), then made a Maven1-to-Maven2 virtual repository as well (maven1as2). Because some of the needed artifacts are snapshots, the policy for maven1 (and by extension maven1as2) is Snapshot.
I imported all of the Maven 1 artifacts through the filesystem to this repository's overridden local storage location.
I then added maven1as2 to my Public Repositories group. Some of the reference I have found says that Nexus will not allow you to browse or search a Maven1 repository. I have had mixed results. If I select Public Repositories or maven1as2 in Nexus, I can go to Browse Storage and drill down to com/sun/tools/jxc/maven2/maven-jaxb-schemagen-plugin/1.3-SNAPSHOT/ and view the maven-jaxb-schemagen-plugin-1.3-SNAPSHOT.pom file and its checksum. However, I cannot view the JAR artifact that should be there and is on the filesystem.
When I try to use Maven to build, I get the following:
$ mvn clean compile
[INFO] Scanning for projects...
[INFO] Reactor build order:
[INFO] MyProject
[INFO] MyModule1
[INFO] MyModule2
...
[INFO] ---------------------------------------------------------------------------
[INFO] Building MyProject
[INFO] task-segment: [clean, compile]
[INFO] ---------------------------------------------------------------------------
[INFO] [clean:clean {execution: default-clean}]
[INFO] [cobertura:clean {execution: default}]
[INFO] No goals needed for project - skipping
[INFO] ---------------------------------------------------------------------------
[INFO] Building MyModule1
[INFO] task-segment: [clean, compile]
[INFO] ---------------------------------------------------------------------------
Downloading: http://my.nexus.server:8081/nexus/content/groups/public/com/sun/tools/jxc/maven2/maven-jaxb-schemagen-plugin/1.3-SNAPSHOT/maven-jaxb-schemagen-plugin-1.3-SNAPSHOT.pom
6K downloaded (maven-jaxb-schemagen-plugin-1.3-SNAPSHOT.pom)
[INFO] ---------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ---------------------------------------------------------------------------
[INFO] A required plugin was not found: Plugin could not be found - check that the goal name is correct: Unable to download the artifact from any repository
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=com.sun.tools.jxc.maven2 -DartifactId=maven-jaxb-schemagen-plugin -Dversion=1.3-SNAPSHOT -Dpackaging=maven-plugin -Dfile=path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=com.sun.tools.jxc.maven2 -DartifactId=maven-jaxb-schemagen-plugin -Dversion=1.3-SNAPSHOT -Dpackaging=maven-plugin -Dfile=path/to/file -Durl=[url] -DrepositoryId=[id]
com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin:1.3-SNAPSHOT
from the specified remote repositories:
nexus (http://my.nexus.server:8081/nexus/content/groups/public)
com.sun.tools.jxc.maven2:maven-jaxb-schemagen-plugin:1.3-SNAPSHOT
from the specified remote repositories:
nexus (http://my.nexus.server:8081/nexus/content/groups/public)
[INFO] ---------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ---------------------------------------------------------------------------
[INFO] Total time: 2 seconds
[INFO] Finished at: Tue Jul 06 15:05:08 EDT 2010
[INFO] Final Memory: 7M/17M
[INFO] ---------------------------------------------------------------------------
Sometimes it happens when working with m2eclipse. You chose a dependency and the default scope is pom and not jar. You didn't show your pom file. validate that all dependencies are jar scoped.
I learned that most of the time rebuilding metadata of the repositories helps to solve such problems.
I find it annoying how often this is necessary.
Select the repository
In the "Browse Storage" tab open the context menu of the root node (it sometimes is hidden behind the Firefox default context menu - pressing Esc helps in this case and brings the Nexus context menu into view)
Select rebuild metadata
Expire cache and reindex may help too for some cases.
Most of the time these steps didn't solve the problem at the first try but at last they solved it each time though.
I run Nexus as a WAR in Glassfish 2.1