I want to build a scala application via the jenkins sbt plugin.
The build.sbt file of my project does not reside in the root directory of the git repository, but in a subdirectory called 'webapp'.
How do i tell sbt within my Jenkins Job that it should do the building in that very subdirectory and not in the workspace root?
If you're using the "Build using sbt" build step, then under the "Actions" field you will find an Advanced… button.
Clicking that will reveal a "Sub-directory Path" configuration option, where you can enter webapp.
Related
In TeamCity I have Version Control settings connected to a git repo, however that repo contains two directories that each have build.xml files (for ant) I wish to only execute tests in one folder. Unsure how to specify a specific directory in my TeamCity project, as it's not finding build.xml in the root directory.
Go to Edit Configuration Settings
Then Build Steps -> Create if needed
Edit Build Step -> Set Working Directory as directory in repo
Run the project build and it should point to specific directory
I am trying to work in GitHub project and I need to understand the code
so when I go to Run as I have just Run configuration
* I installed JUnit plugin for eclipse
that is the my screen:
You should import hipster-examples as a separate project, so that eclipse recognize the src folder as a source folder.
try to create a new empty workspace and follow this steps:
righ click on package explorer
Import...
Existing maven projects:
set as root directory the root path of your local git
repository - using your example as a reference, what I mean is the root path of "hipster" project and select all the projects:
Now everything should work fine:
As you can see in these screenshots, as a result, there is NOT one single project containing everything, but there are all the projects, each of them declared as a "root element" of the workspace.
I want to publish an open source library to my own remote nexus repo. I try to change .sbt files for the library but sbt publish still tries to release using the normal sonatype nexus repo. sbt publish-local works fine for a different local project so I think that maybe I can deploy this lib without changing the .sbt files to my remote nexus.
Can I publish this lib only with added credentials in the command line?
I have a maven project, which will produce a jar file, and I want to use it in another sbt project. Is there any method to publish the jar file to .ivy rather than in .m2?
I try to put the jar file in the libs under the sbt project, but it does not work. and use the mvn install the jar to the .m2 does not work too.
As I understand it you have a maven project and an SBT project. The SBT project depends on the artifact produced by your maven project.
You ask how to publish the maven produced artifact to your local .ivy so it can be picked up by the SBT project.
you can probably achieve that using an ant task in the maven build.
However I'd like to suggest different angles :
Make the sbt project aware of the local .m2
Simply add resolvers += Resolver.mavenLocal to your sbt build definition, if you don't want to pollute the main build definition, add that line to a local.sbt file alongside the main build defition. SBT merges all the .sbt files found at the project root.
Publish to a controlled repository
This is especially useful if you want the build to be easily reproduceable outside of your local machine.
The idea is simply to publish the maven project to an actual server, either an internal nexus/artifactory server for proprietary code or to a public artefact hosting (such as bintray)
I use bintray all the time to publish custom builds of opensource projects while I wait for PRs to be merged in master and published an the official build.
Add your artifact server as a resolver to the SBT project and you are good to go :)
I'm using eclipse. I created a git repository and pulled some code from a url. I want to run that code but when I try to run, I get this error:
Select what to run:
Ant Build
Ant Build...
Is the code in git repository not executable?
How can I run this project? Any help is appreciated.
A git repo doesn't know about the nature of the text files it stores: it just make sure they are replicated exactly the same.
Once clone, you need to check haw the project work, independently of Git.
In this case, see "Eclipse: Running Ant buildfiles", or use the Ant view in Eclipse.
You can make one of the ant target run automatically too.
If this isn't an ant project, see:
"what is this ANT build?".
make sure your java project as a builder (if not, by default, Eclipse proposes ant), as in "Eclipse won't compile/run java file"