How to share a dependency that isn't in Clojars - clojure

I need to use the mongo-storm library and Clojars doesn't have it. So I cloned the project, compiled and copied the jar to my lib folder by hand. But it is a team project and it is unacceptable for every member to do those steps by hand.
Are there any better and standard ideas on how to solve this issue?

Your team should have a private repository for this purpose. S3 is an ideal substrate for this, and you can use the s3-wagon-private Leiningen plugin to deploy and consume artifacts to/from a secured S3 bucket:
https://github.com/technomancy/s3-wagon-private

If the project has a license that allows it (if it's open source) you are allowed to push your own unofficial version to Clojars yourself using your own group ID. Clojars reserves the "org.clojars.username" group IDs for this purpose. This is described in https://github.com/ato/clojars-web/wiki/tutorial and https://github.com/technomancy/leiningen/blob/master/doc/DEPLOY.md .
The best way would probably be if you could contact the author and to urge him/her to do a proper release. (Also, the readme doesn't tell what license the project has.)

A solution that doesn't require setting up a private repository would be to leverage the checkouts capability in leiningen.

Ideally, if your team is using a maven based dependency management system (like Leiningen), you would have a repository manager set up. You can then deploy the library to your team's repository manager.
Most repository managers have Maven Central already included and make it easy to both add additional repositories to proxy (e.g. Clojars) and host your own repositories (for mongo-storm and the project being developed).
After getting one set up, one of the things you'll want to make sure your team does is either set as a repository proxy or as an additional repository to pull jars from.
You can find a list of repository managers on the maven site.

Related

Adding modules/themes to a platform after it has been built

New user here...
Installed D8+Civi by building a composer based git repo for the platform then stamping out a few test sites.
It worked really well.
But now I am at the point of realizing I missed a few modules and I want to add some themes to apply to the sites.
I can easily to it in the git which was used to define the platform. But what is the proper way to manage the central platform data and files that are then used for the x number of sites.
I know the docs try to discuss this be a tutorial walk-through would be very helpful.
As a guess, I could make the central platform files a git clone and pull down clones for the new stuff. But if there was a need for an database updates that wouldn't get done.
Ideas?
Thanks
It's not clear what you mean by "central platform data".
If you mean assets that are relevant for the entire platform, that can apply to all of the sites, you would do the following:
Add anything new to Git and push it.
Create a new platform to match the latest code in Git.
Ran a Migrate task on the old platform to migrate the sites to the new one.
Database schema updates happen automatically.
The sites will now be running on the new codebase.
If you're talking about site-specific assets that you don't want to be included in the platform's code, then you can enable Git for sites with the Aegir Hosting Git module.
It allows you to deploy site-specific Git repositories.
However, I don't recommend using that module for platforms, just sites, because it allows you to git pull on Production sites, which is a terrible idea. For that, see Aegir Deploy.
Both of these modules ship with Aegir so you won't need to install them. Some of the Hosting Git features may need to be enabled, however.

How can I publish serverless application on AWS faster?

I do not know how this question is logic but if there is anyway to solve this issue, it will cause to not waste my time.
I have a ASP.net core application that consist of many libraries like jquery, modernizer and etc. All of them stored in lib folder in wwwroot folder.
When I start publishing on AWS (with AWS Toolkit) it start zipping and publishing on the server as usual.
The point is that it will take a lot of time for zipping all of the libraries. these library does not any change during the project and I just change some pages or classes.
Is there any way to cancel zipping some folders to publish faster?
You can add this in your AWS serverless template to remove unwanted packages from the bundle.
package:
exclude:
- scripts/**
- dynamodb/tables/**
- policies/**
- dynamodb/seeds/**
If you are using a CI/CD methodology then you can ask the code builder to use a script in a root folder structure to run your package resolvers and all. Please refer this documentation

where to find specific version of aws-java-sdk?

I want to download aws-java-sdk-1.9.5, could not find any archive for this jar.
Whatever I am finding is the latest jar from AWS site https://aws.amazon.com/sdk-for-java/
I also checked maven repository but there the available jar is of 2 KBs only that didn't contain any source in the jar.
http://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk/1.9.5
Any suggestion would be appreciated.
You can download from official AWS Repo.
Here is the link for version 1.9.5
The aws-sdk-java JAR contains a list of dependencies on all other JARs in the AWS SDK. If you depend on it, then by Maven's transitive dependency mechanism you will add all of the other SDK JARs to your dependency tree.
Which you do not want to do
I've lost count of the number of individual AWS JARs, but there are a lot -- certainly dozens, possibly as many as a hundred. There's one JAR (at least) per AWS service, most of which you will never use.
A better approach is to download that JAR so that you know the names of the dependencies, then import them individually.

How to add github libraries to gradle workflow?

I'm new to build tools and gradle. I'm currently developing for android. I've found a library on Github I would like to use in my app.
What is the best way to create this dependency? The library doesn't have ant, maven or even gradle support.
Some options that came to my mind:
1) Fork the repo and add gradle support.
2) Clone the repo and add maven support then add it to the local maven repo.
What do the experts think how to handle such dependencies?
If the library only publish sources, not binaries, you don't have any other option rather than build it yourself.
Once you did that, you can host the binary in binary repository (like Artifactory) for sharing it with your colleagues, or even publish it on a distribution platform (like Bintray) for anyone who want to use it. For the later, you'll be able to pass the ownership (and the maintenance burden) to the original author in any moment.

How do you configure proprietary dependencies for Leiningen?

We're working on a project that has some Clojure-Java interop. At this point we have a single class that has a variety of dependencies which we put into a user library in Eclipse for development, but of course that doesn't help when using Leiningen (2.x). Most of our dependencies are proprietary, so they aren't on a repository somewhere.
What is the easiest/right way to do this?
I've seen leiningen - how to add dependencies for local jars?, but it appears to be out of date?
Update: So I made a local maven repository for my jar following these instructions and the lein deployment docs on github, and edited my project.clj file like this:
:dependencies [[...]
[usc "0.1.0"]]
:repositories {"usc" "file://maven_repository"}
Where maven_repository is under the project directory (hence not using file:///). When I ran "lein deps"--I got this message:
Retrieving usc/usc/0.1.0/usc-0.1.0.pom from usc
Could not transfer artifact usc:usc:pom:0.1.0 from/to usc (file://maven_repository): no supported algorithms found
This could be due to a typo in :dependencies or network issues.
Could not resolve dependencies
What is meant by "no supported algorithms found" and how do I fix it?
Update2: Found the last bit of the answer here.
add them as a dependency to your leiningen project. You can make up the names and versions.
then run lein deps and the error message when it fails to find it will give you the exact command to run so you can install the jar to your local repo then sould you decide to use a shared repo you can use this same process to put your dependencies there.
#Arthur's answer is good but I figured I'd flesh it out a bit more since it leaves some details lacking.
Always keep in mind Repeatability. If you don't make it so that anyone who needs access to the artifacts can get access to the artifacts in a standard way, you're asking for support hell.
The documentation on deployment is a good place to go to find out everything you need to know about deploying your artifacts. Since you're in a polyglot environment you probably can't have lein take care of deploying all your artifacts but at least you can get your clojure specific jars up into S3 or even a file share if you like. The rest of your artifacts will have to use Maven or Ant directly to upload the artifacts to the Maven repo on the file server or S3. At my current company we are using technomancy's excellent s3 wagon private to great effect for hosting our closed source artifacts and clojars for hosting anything that we can open-source.
What #Arthur is referring to is doing a lein install. All that does is install a copy of the current project into your local .m2 directory so that other projects on your box can reference them. Unless you have configured your install of maven to use a shared directory for your .m2 folder (maybe not a bad idea in your environment?), this will mean that anyone else who checks out your project will not be able to build it. If you wanted to go this route, you need to set the localRepository node in your $M2_HOME/conf/settings.xml to be the shared location that the rest of your team has access to. See the docs for more information.
YMMV but I've found it best to use Maven rather than Leiningen when you are working with Polyglot Clojure / Java projects.
It's mainly because the Java based tools (Eclipse etc.) understand Maven projects but don't really understand Leiningen projects. It's getting slowly better with the excellent Counterclockwise Clojure plugin, but the integration still isn't quite good enough yet for an efficient IDE based workflow.
On the repository side of things, I'd suggest setting up a private shared Maven repository. You're going to need it sooner or later if you plan to manage a complex set of dependencies within your team: might as well bite the bullet and get it done now.