I'm trying to deploy a (non-snapshot) library to Clojars using Leiningen. I've actually been able to deploy this library before but it was a while ago and now I've made some fixes that I want to release. I even have a small bash script that used to handle the release and deploy process that essentially just do:
RELEASE_VERSION=${releaseVersion} lein release
Where releaseVersion is supplied as a parameter to the script. I'm using the lein-release plugin and I've specified:
:lein-release {:deploy-via :clojars}
in my project.clj. I also have working (or at least they used to work) GPG credentials in /Users/johan/.lein/credentials.clj.gpg.
When running lein release I'm prompted for my GPG password but after a couple of seconds I run into this:
$ RELEASE_VERSION=0.2.1 lein release
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
[master cf4e5d1] Version 0.2.1
1 file changed, 1 insertion(+), 1 deletion(-)
You need a passphrase to unlock the secret key for
user: "Johan <email>"
2048-bit RSA key, ID ABC123431, created 2015-11-12
No credentials found for releases (did you mean `lein deploy clojars`?)
Password prompts are not supported when ran after other (potentially)
interactive tasks.
See `lein help deploy` for an explanation of how to specify credentials.
I've also tried setting repositories in my project.clj:
:repositories [["releases" {:url "http://clojars.org/repo" :creds :gpg}]]
But it doesn't make any difference. Does anyone know how to solve this?
The problem was that I had accidentally removed [lein-release "1.0.9"] from {:user {:plugins .. }} in my ~/.lein/profiles.clj file. When I added it again everything worked as expected.
I have the following directory layout
./www/index.php
Dockerfile
apache-config.conf
I then zip up the file and upload it onto Elastic Beanstalk, but I get the following error message:
[Instance: i-572d1ae8] Command failed on instance. Return code: 1 Output: Dockerfile and Dockerrun.aws.json are both missing, abort deployment. Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/03build.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
The log file contains the following message:
AppDeployPreHook/01unzip.sh] : Completed activity. Result:
Archive: /opt/elasticbeanstalk/deploy/appsource/source_bundle
creating: /var/app/current/DI_Test/
inflating: /var/app/current/DI_Test/.DS_Store
creating: /var/app/current/__MACOSX/
creating: /var/app/current/__MACOSX/DI_Test/
inflating: /var/app/current/__MACOSX/DI_Test/._.DS_Store
inflating: /var/app/current/DI_Test/apache-config.conf
inflating: /var/app/current/DI_Test/Dockerfile
inflating: /var/app/current/__MACOSX/DI_Test/._Dockerfile
creating: /var/app/current/DI_Test/www/
inflating: /var/app/current/DI_Test/www/.DS_Store
creating: /var/app/current/__MACOSX/DI_Test/www/
inflating: /var/app/current/__MACOSX/DI_Test/www/._.DS_Store
inflating: /var/app/current/DI_Test/www/index.php
[2015-10-29T14:01:33.279Z] INFO [2865] - [Application deployment/StartupStage0/AppDeployPreHook/03build.sh] : Starting activity...
[2015-10-29T14:01:33.579Z] INFO [2865] - [Application deployment/StartupStage0/AppDeployPreHook/03build.sh] : Activity execution failed, because: Dockerfile and Dockerrun.aws.json are both missing, abort deployment (ElasticBeanstalk::ExternalInvocationError)
caused by: Dockerfile and Dockerrun.aws.json are both missing, abort deployment (Executor::NonZeroExitStatus)
Why is my dockerfile not being read here? I can build the image and run it just fine without Elastic Beanstalk.
Sharing another possibility:
You were testing eb and you've just added your Dockerfile.
According to the doc
If git is installed, EB CLI uses the git archive command to create a
.zip file from the contents of the most recent git commit command.
That's saying if your Dockerfile is not committed, it won't be zipped in therefore your instance can't find it.
Compress those stuff within your project folder(go into your project folder and zip everything), instead of zipping your project folder.
You don't need to include parent directory in zip file. Suppose you want to zip ./www/index.php ,Dockerfile and apache-config.conf then,
zip dist.zip Dockerfile ./www/index.php apache-config.conf
The upload dist.zip.
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features.deployment.source.html
I've come across this issue as well. It seems a Dockerrun.aws.json file is required as well. I believe that is because other files are included in the app. If you had only a Dockerfile and nothing else, it wouldn't be required.
Here's the documentation: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_image.html
In my case there was a spelling mistake in Dockerfile name i.e DockerFile. Elastic Beanstalk is case sensitive.
Super newbie mistake, but when I had this problem it was because my Dockerfile was actually Dockerfile.txt. After removing the .txt extension and creating a plain file it worked fine.
I had the same issue. The solution is to go to the actual directory that you are trying to zip and then run: zip name_of_file.zip *. Then the Dockerfile will get the exact same zip filename "Dockerfile", which is what Elastic Beanstalk is looking for.
If you zip from outside your directory, the Dockerfile's name will be "directory/Dockerfile", and that is what causes Elastic Beanstalk to fail.
I had a different problem. Using directly json, the Dockerrun files can have the form of Dockerrun_${DOCKER_TAG}.aws.json.
Solution: In zips, only Dockerrun.aws.json is allowed.
Two possible problems:
1) When zipping the folder enter the folder and zip from the command line or in finder select each file individually then zip together.
Example: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/applications-sourcebundle.html
2) Elastic Beanstalk is case sensitive so make sure your file is labeled "Dockerfile" not "dockerfile"
I was trying to upload a zip which contained a singular file Dockerrun.aws.json. But docs state:
If you use only a Dockerfile or only a Dockerrun.aws.json file to deploy your application, you don't need to create a .zip file
So you can simply upload either one or another without zipping it.
To document just another way to get into this - added by mistake Dockerfile in the .ebignore file. I was testing non-docker and docker deploys and worked from the same directory. Dockerfile is not obviously needed with regular deploys but should not be added to .ebignore when doing docker deploys.
I added the dockerrun.aws.json and config.yml in a folder called .elasticbeanstalk/ which is in the root folder.
We have some 3rd-party jars checked-in to our project. We'd like to add them to the classpath. That's it. We don't want to set up a local maven repo (because that would break our 'check out and run' philosophy). Each developer would have to set up their own maven repo, distinct from the project.
Is there a way to do this or is this? Most of the answers I've seen say to set up a local maven which we don't want or need just to add a jar to a classpath.
You will need to setup a local maven repository, but that can be a simple directory, in your project directory, that you then check in to source control. (Which will maintain your 'check out and run' policy)
As of Leiningen 2.2.0 the functionality to deploy jars is built-in with the lein deploy task. So, the task has simplified from previous versions.
Create a directory inside your project called, in this example, myrepo. (The name is arbitrary)
Add a :repositories entry in your project.clj file with a path to the local directory you created.
:repositories [["localrepo1" "file:myrepo"]]
Deploy your free floating jar to the repo.
lein deploy localrepo1 com.blueant/fancypants 1.0.1 fancypants.jar
And, add your dependency to your project.clj :dependencies vector as normal.
:dependencies [[com.blueant/fancypants "1.0.1"]]
The deploy task will generate the checksums and directory structure required to to tie into the lein dependency resolution. You can verify your jar is loaded correctly with the lein deps :tree command.
Note: File paths in :repositories are formatted as URLs. So, /Users/user1/Desktop is file:///Users/user1/Desktop, and, a local directory within the project, myrepo is file:myrepo.
I'd like to elaborate on #Jared314's excellent answer that helped me as well.
Below is a script that automates the process of adding multiple jars from a local lib folder to a local repository:
#!/bin/sh
export LOCALREPO_USERNAME=
export LOCALREPO_PASSWORD=
for file in lib/*.jar
do
name=$(basename "$file")
basename=${name%.jar}
echo "Deploying $basename"
artifactId="local/$basename"
lein deploy localrepo1 $artifactId 1.0 $file
echo "[$artifactId \"1.0\"]" >> dependencies.log
done
The list of Leiningen dependencies that can be added to project.clj is stored in dependencies.log.
Before running the script, :repositories entry in project.clj has to be updated to allow for reading repository username and password from the environment:
:repositories [["localrepo1" {:url "file:myrepo"
:username :env/localrepo_username
:password :env/localrepo_password}]]
This will prevent the repository password prompt from displaying when running the script.
This question has already been answered here.
It is indeed possible, but there's a reason why maven and dependency management exists. If you have many dependencies changing versions creating a repo is the recommended approach.
I am trying to set up the WSO2 Endpoint look-up sample. I have made the changes according to the documentation, but when I try to build the app using "mvn clean install" I am receiving the following error:
Downloading: http://maven.wso2.org/nexus/content/groups/wso2-public/eclipse/vali
dateutility/0.95/validateutility-0.95.pom
[WARNING] Checksum validation failed, expected 53f8bac71524372a3d51a6ecf11365042
96f37af but is 8edc83998e0bf2a8867395883f3853eb901be267 for http://maven.wso2.or
g/nexus/content/groups/wso2-public/eclipse/validateutility/0.95/validateutility-
0.95.pom
Downloading: http://maven.wso2.org/nexus/content/groups/wso2-public/org/eclipse/
osgi/org.eclipse.osgi.services/3.2.0.v20090520-1800/org.eclipse.osgi.services-3.
2.0.v20090520-1800.pom
[WARNING] Checksum validation failed, expected <!DOCTYPE but is 8edc83998e0bf2a8
867395883f3853eb901be267 for http://maven.wso2.org/nexus/content/groups/wso2-pub
lic/org/eclipse/osgi/org.eclipse.osgi.services/3.2.0.v20090520-1800/org.eclipse.
osgi.services-3.2.0.v20090520-1800.pom
The checksums are failing. Does someone need to update the files in the repository?
I managed to get the handler sample to build by:
1) Checkout the Greg 4.5.3 Source Code:
svn co https://svn.wso2.org/repos/wso2/carbon/platform/tags/4.0.5/products/greg/4.5.3/ wso2_greg_453
2) Build the source:
cd wso2_greg_453
mvn clean install -Dmaven.test.skip=true
I had a build failure due to maven issues cleaning up surefire reports, which I ignored.
3) Build the handler sample in the directory I unzipped the binary version of GREG to:
cd %CARBON_HOME%
wso2greg-4.5.3\samples\handler\src
mvn clean install
This time the handler sample built ok.
The approach above is a bit long winded, but it works!
i'm trying to build wso2 governance registry by src files with maven 3, but after many retries i'm stuck too.
I had dowload all required libraries, and fixed all duplicate child in pom files, but whem i'm trying to build i obtain this error.
"[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.
2-beta-5:attached (dist) on project axis2-kernel: Failed to create assembly: Err
or creating assembly archive docs: You must set at least one file. -> [Help 1]
[ERROR]"
and previously
"[FATAL] Non-readable POM C:\greg\wso2greg-4.1.1-src\dependencies\axis2\1.6.1-wso2v1\modules\pom.xml: C:\greg\wso2greg-4.1.1-src\dependencies\axis2\1.6.1-wso2v1\modules\pom.xml (Impossibile trovare il file specificato) #
for project at C:\greg\wso2greg-4.1.1-src\dependencies\axis2\1.6.1-wso2v1\modules\pom.xml for project at C:\greg\wso2greg-4.1.1-src\dependencies\axis2\1.6.1-wso2v1\modules\pom.xml"
I'm trying to build with maven 2 but, even if console output message shows "BUILD SUCCEFFULL" i can found bin folder and relative wso2server.bat file.
Anyone can help me?
Please clone below repos and run an mvn clean install -e on each and everyone accordingly.
https://github.com/wso2/carbon4-kernel.git
https://github.com/wso2/carbon-registry.git
https://github.com/wso2/carbon-governance.git
https://github.com/wso2/carbon-governance-extensions.git
https://github.com/wso2/carbon-store
Then build G-Reg from the source!
Note: Current G-Reg developer snapshot :https://github.com/wso2/product-greg.git