Specifying a relative source directory - sbt

I have just recently forked an outdated SBT project (which you can find here https://github.com/mdedetrich/sbt-bower) that was last working with an outdated version of SBT 0.11.0. I am trying to get the sbt plugin to work with SBT versions 0.12.3 and 0.13.0, however I am getting an issue on this line
https://github.com/mdedetrich/sbt-bower/blob/master/src/main/scala/SbtBowerPlugin.scala#L37
When I run sbt compile, I get the following error
[error] /Users/mdedetrich/github/sbt-bower/src/main/scala/SbtBowerPlugin.scala:37: value / is not a member of java.io.File
[error] sourceDirectory in Bower <<= (sourceDirectory).apply (_ / "main" / "webapp" )
Does anyone know what is causing this issue?

Thanks to Mark Harrah, this is actually due to this https://groups.google.com/forum/#!topic/simple-build-tool/0k1No2kfvm8/discussion
I had to remove the import Path._ in the SbtBowerPlugin.scala file and it now compiles fine!

Related

Sbt Cannot Resolve "latest.integration" Version

When I try to resolve the following dependency with Sbt "com.dixa" % "conversation-thrift-protocol" % "latest.integration", it fails with:
[error] (ssExtractDependencies) sbt.librarymanagement.ResolveException: Error downloading com.dixa:conversation-thrift-protocol:latest.integration
[error] not found: https://repo.dixa.io/content/repositories/snapshots/com/dixa/conversation-thrift-protocol/maven-metadata.xml
As a matter of fact, the referred maven-metadata.xml file does exist in Nexus repo, which leaves me puzzled. Where should I look for a problem?
The contents of the maven-metadata.xml file:
<metadata>
<groupId>com.dixa</groupId>
<artifactId>conversation-thrift-protocol</artifactId>
<versioning>
<versions>
<version>7.10.1-SNAPSHOT</version>
<version>7.10.1--v2-SNAPSHOT</version>
<version>7.10.1-v2-SNAPSHOT</version>
<version>7.10.1-v6-SNAPSHOT</version>
<version>7.10.1-v7-SNAPSHOT</version>
</versions>
<lastUpdated>20220517141646</lastUpdated>
</versioning>
</metadata>
It appeared to be a problem with indexing of the repository: the published artifacts were not visible straight away, they needed some time before becoming visible for resolvers

sbt lagom template+InvalidRemoteException

I tried to follow the follow tutorial:
https://www.lagomframework.com/documentation/1.4.x/java/GettingStartedSbt.html
For generating the project scaffolding, I want to use the following template:
sbt new lagom/lagom-java.g8
But already receive the following error:
[error] org.eclipse.jgit.api.errors.InvalidRemoteException: Invalid remote: origin
A bit frustrating at such early stage in the tutorial...
Any idea how to fix this?
Edit: the error is caused by:
[error] Caused by: org.eclipse.jgit.errors.NoRemoteRepositoryException: https//github.com/lagom/lagom-java.g8.git: not found.
Seems there is a :missing after https. How to fix?
Verify you have the prerequisites. Prerequisites documented here https://www.lagomframework.com/documentation/1.4.x/java/JavaPrereqs.html
I just followed the instructions and was unable to reproduce the error from the CLI using sbt version 1.1.1.
What version of sbt are you using?

OPAL-How to build code in Docker in local machine (faced compile error)?

I access code in Docker($docker pull mreif/fse2016:evaluation), the code could be compiled and run without errors in remote server. While i download it to local machine, i suffered some errors in compiling(using: sbt compile):
[error] (*:update) sbt.ResolveException: unresolved dependency: de.opal-project#abstract-interpretation-framework_2.11;0.9.0-SNAPSHOT: not
[What i have done] I added follow lines into "build.sbt":
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
[error] evaluation/src/main/scala/org/opalj/evaluation/EntryPointAndCallEdgeCountAnalysis.scala:90: not found:
[What i have done] I added follow lines into "build.sbt":
libraryDependencies += "de.opal-project" % "fixpoint-computations-framework-analyses_2.11" % "0.9.0- SNAPSHOT"
3.[error] /src/main/scala/org/opalj/evaluation/EntryPointAndCallEdgeCountAnalysis.scala:130: not found: value LibraryEntryPointsAnalysis
I have checked the related code, LibraryEntryPointsAnalysis has been actually imported but doesn't work.
Could you please help me to confirm is there any operations i missed for compile the source code?
Thank you very much!
Jiang
The reason why it is not working is a version mismatch of the OPAL framework. The reason why it doesn't find the "LibraryEntryPointAnalysis" is, that it has been renamed.
You have to options:
Use the version of OPAL that is used in the Docker container
make a check out of OPAL at from version tag "ArtifactEvaluationFSE2016"
copy OPAl from the container like you did with the evaluation project
Adapt the Evaluation Project to the new API
the LibraryEntryPointsAnalysis is now called EntryPointAnalysis
there are probably other breaking changes that you have to fix
If you want to go with option one you have to build OPAL on your own because the eval version is not published on maven.

sbt doc error with Antler generated source code

I have ANTLR to generate parser/lexer code in "./gen" directory.
With sbt, everything works fine; no issue with compile and test.
However, when I executed doc to invoke scaladoc, I have error messages saying that it cannot find the object that ANTLR generated.
> doc
[info] Main Scala API documentation to /Users/smcho/github/ChitchatCompilerScala/doc/api...
[error] /Users/smcho/github/ChitchatCompilerScala/src/main/scala/node/NodeGenerator.scala:6: not found: object parser
[error] import parser.{ChitchatLexer, ChitchatParser}
[error] ^
What might be wrong?
I had to teach sbt about the new source directory.
unmanagedSourceDirectories in Compile += baseDirectory.value / "extra-src"
Hint from http://www.scala-sbt.org/0.13/docs/Howto-Customizing-Paths.html

Grunt error SailsJS when lifting with --no-frontend

I have a Sails Api which the first time boots like a charm.
Press CTRL + C to stop it and then try to start it again. It works, BUT,
error: ** Grunt :: An error occurred. **
error:
------------------------------------------------------------------------
Aborted due to warnings.
Running "clean:dev" (clean) task
Warning: Cannot delete files outside the current working directory.
------------------------------------------------------------------------
error: Looks like a Grunt error occurred--
error: Please fix it, then **restart Sails** to continue running tasks (e.g. watching for changes in assets)
error: Or if you're stuck, check out the troubleshooting tips below.
error: Troubleshooting tips:
error:
error: *-> Are "grunt" and related grunt task modules installed locally? Run `npm install` if you're not sure.
error:
error: *-> You might have a malformed LESS, SASS, CoffeeScript file, etc.
error:
error: *-> Or maybe you don't have permissions to access the `.tmp` directory?
error: e.g., `folderthingy` ?
error:
error: If you think this might be the case, try running:
error: sudo chown -R 501 folderthingy
Well, I check it all, and the folder just is my own and has enough rights. I also put up a 777 for testing purposes but this didn't change a thing.
Then, I decided to clear out all the contents of the .tmp folder and try to boot again. This worked like a charm, .tmp got filled again, and when I stopped the server, tried to reboot it, I got the exact same error message again!
I'm booting with the --no-frontend option, so in fact I don't understand why it even wants to load grunt.
Why is this happening? What's going wrong here?
Why it happens is still not known to mankind, but I fixed it with removing the Gruntfile.
Fixed this by following below steps :
File path in your sails app -> tasks/config/sync.js
// 1. Install it as a local dependency of your Sails app:
// ```
// $ npm install grunt-sync --save-dev --save-exact
// ```
//
//
// 2. Then uncomment the following code:
//
// ```
// // Load Grunt plugin from the node_modules/ folder.
// grunt.loadNpmTasks('grunt-sync');
// ```
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Note: Work for Warning "sync:dev" not found
If you are using Linux, try doing sudo sails lift, you can have problems with permissions (happened to me). If Windows - check that no file manager or some other program is blocking the .tmp folder (also happened to me when I opened the folder in Total Commander).
In any case, since you don't use frontend, you can simply remove some of the grunt tasks (in the folder tasks/ you have README.md which explains which tasks are run in which case) or all of them (see documentation) and you won't have the problem.
i also got this error-
error: ** Grunt :: An error occurred. **
error:
------------------------------------------------------------------------
Aborted due to warnings.
Running "sass:dev" (sass) task
> error: Looks like a Grunt error occurred--
>
> error: Please fix it, then **restart Sails** to continue running tasks
> (e.g. watching for changes in assets)
>
> error: Or if you're stuck, check out the troubleshooting tips below.
error: Troubleshooting tips:
error:
error: *-> Are "grunt" and related grunt task modules installed locally? Run `npm install` if you're not sure.
error:
error: *-> You might have a malformed LESS, SASS, CoffeeScript file, etc.
error:
error: *-> Or maybe you don't have permissions to access the `.tmp` directory?
error: e.g., `/Users/siyaram.malav/Desktop/repo/project1/.tmp` ?
this error came because it could not find the sass module.And ran following command
sudo gem install sass
it worked for me.
In your case, try running sudo gem install clean command.
it should work.
thanks.
I had the same problem while following this tutorial:
https://www.youtube.com/watch?v=ZE7ye2G_H9Q&index=4&list=PLf8i4fc0zJBzLhOe6FwHpGhBDgqwInJWZ
I created a "linker" folder since that's what the guy did, which then prompted me with the error. It looks like he's using an older version of SailsJS since he runs into no errors.
Did you by any chance create a new folder in the assets folder? If you did, the problem is that grunt isn't able to run tasks on the specific folder since it's not linked with the rest of the assets folders and files. Try placing all newly created files within already existing folders and trying again. This worked for me.

Resources