How to publish open source library to my nexus server with sbt - scala

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?

Related

Local maven repository in Eclipse installation

How can I copy a resource during Tycho build from Nexus repository so that it resides in Eclipse install directory once it's uncompressed? My end goal is to copy archived Maven repository to Eclipse install directory and use that as local Maven repository.
In our Eclipse application we use Shrinkwrap Resolver to fetch runtime jar dependencies from Nexus repository and add them to ClasspathContainer. This works well, however there will be instances when application will be running in environment that has no Internet connection. For this we need Maven repository to reside where our Eclipse application is installed - parallel to features, plugins directories; this is the best location I can think of where to host this repository.

How to amend and install Jenkins plugin from Github

I have forked my own repo of a Jenkins plugin on Github (and made some changes), and I have downloaded it as .zip file. How can I install this onto Jenkins? I assume I need to convert the .zip contents into a .hpi, but not sure how to do this?
I worked this out by creating a Maven project in Eclipse then running the maven command "package" against the pom.xml, this is what produces the .hpi file.

maven publish jar to .ivy

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 :)

How to publish multiple jar files to repository sbt

I have multi module project and using Build.scala to build. I am using nexus repository to publish.
Project structure is like
NLP
Core
Project1
Project2
Now say Project1 depends on Core and Project2 depends on Core and Project1 and lastly main project has dependency on all these jars.
When I do publishTo nlp.jar and pom.xml gets published to repository
I also would like to publish jars from other projects as well so those are available to consumer project. However somehow I am able to publish only nlp.jar and other projects jar and pom files are not getting published.
I tried to even look at following link however that did not help.
publish jar files with sbt (3rd party)
Thanks for help in advance.

Maven dependency in Local Repository but not being picked up

The dependency I'm using is for Oracle which, reading from another post, is not included in the default maven repo due to legal issues. For this reason I've added the dependency to my local repo using:
mvn install:install-file -Dfile=/home/<myname>/development/Libraries/ojdbc6.jar
-DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.3 -Dpackaging=jar
My problem is that maven is attempting to pull the file from the default remote repo and failing although it was my understanding that the local repo is checked first.
My install of maven is the default version packaged with STS (basically Eclipse).
Kind Regards,
Justin
Checking whether the jar got properly installed in your local repository might help. If you navigate to the .m2/repository/com/oracle/ojdbc6/11.2.03/ you should find the jar present there.
if this problem is present, i can suggest you to select the Offline option on maven uptade project. Whith this option enabled, the maven install search for local repository.