Is direct-to-heroku-client compatible with latest heroku API jar? - java

I've already configured my project to use direct-to-heroku-client.jar (https://github.com/heroku/direct-to-heroku-client-java) with heroku-api-0.24.jar and
when I test deploy of WAR artifact - it says "Failed to deploy 'war-test-artifact': com.herokuapp.directto.client.DeploymentException: Deploy not accepted".
I investigated that within direct-to-heroku-client API artifact might be uploaded to https://direct-to.herokuapp.com:443/direct during deploying, but it does not happened. So, I just want to know, if
https://direct-to.herokuapp.com:443/direct will be support soon somehow or not and is the direct-to-heroku-client relevant to heroku API v3?

That project is deprecated, and not supported (I updated the docs to reflect this).
Instead, you should be using either:
Heroku Maven plugin
Heroku Deploy CLI
For more information, see the Heroku Dev Center article on WAR Deployment.

Related

How to run java Google App Engine locally with app-gradle-plugin for yaml?

I am using Google App Engine gradle plugin with yaml file, but the plugin version for it has no task appengineRun or appengineStart like the appengine-web.xml version.
TL;DR appengineRun is only available for appengine-web.xml based projects. If you want to use app.yaml, you must provide your own server, for example Spring Boot with Jetty or Tomcat.
To run your application locally, you must provide your own server.
This guide shows how to test your application using app.yaml alongside with the app-gradle-plugin, on section Testing your application with the development server:
During the development phase, you can run and test your application at any time in the development server by invoking Gradle:
gradle jettyRun
Alternatively, you can run Gradle without installing it by using the Gradle wrapper.
As said on this comment on GitHub:
If you want to use app.yaml from your root directory, you must upgrade to Java 11. Learn more here. With the Java 11 runtime, you must provide your own server, for example Spring Boot with Jetty or Tomcat. The appengine:run goal does not work for app.yaml based projects because each server has a different start up command i.e. spring-boot:run for Spring Boot.

Why Heroku GitHub deploy is failing

I am working a Java REST api for a hobby project and I am using Heroku as my deployment platform. I managed to deploy the application using
heroku-maven-plugin.
Then I integrated my GitHub repo with heroku app and tried to deploy from master branch. But then it fails with the following message
Failed to detect set buildpack https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/java.tgz
More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
!Push failed
Can you please explain how to fix this?
Update :
I have tried setting the buildpack to heroku/java from both dashboard and the heroku CLI tool. But still the problem remains.
GitHub : online-activity-diary-api
The Heroku Maven plugin and Github deployment to the same app are not compatible. They use different buildpacks that do different work. You'll first need to make sure your deploying to different apps with these two mechanisms.
When you deploy with Github sync, you'll need to make sure your buildpack is configured to heroku/java in the dashboard. Then make sure your application has a pom.xml checked into Git.

Running a multi project Maven-built webapp on Heroku?

I'm migrating my multi project Java webapp from Cloudbees to Heroku. I have one main webapp that depends on 3 other library projects that I have written (also Maven+Java). On Cloudbees this was simple, you just build everything through Jenkins, the JARs get poked into their Maven repos then the main webapp gets built taking its dependencies from that Maven repos.
However, I can't for the life of me find a way of doing this on Heroku without doing something horrendous like this:
https://devcenter.heroku.com/articles/local-maven-dependencies
By doing so it would mean that every time I changed a library I would have to remember to deploy the built JAR to the main webapp project and push this to Git, somewhat defeating the point of using Maven!
I understand that the way to deploy your webapp on Heroku is essentially by doing a git push to their repo, but how can I tell heroku at the other end to find my library dependencies without having to bundle them in the main webapp like this article suggests?
I would assume that there is some way to set up a private maven repos on your heroku account but I can't find anything like this.
I think the best solution is to use a private Maven repository, and then add the config for that repo in the settings.xml of your main project. This article on using a custom settings.xml describes how to do that.
There are some services that host private Maven repos for you, such as JFrog. But I've even read of people using Github to host a Maven repo, too.

JarJar'ed artefact and Maven deploy process

I am currently developing an SDK targetting both servers and Android devices.
My deliverable JAR is JarJar'ed, thus preventing any dependency leaks from happening in client apps (using maven-jarjar-plugin).
However, there is one issue that puzzles me. A standard Maven deploy will ship sources, POM and other things. The problem is that any Maven-compatible build tool (e.g.: Gradle) will first resolve our SDK according to the deployed POM, thus triggering the pointless downloads of my SDK dependencies (remember: they are JarJar'ed in the final JAR!).
How can I deploy my SDK so that any build tool will understand there is nothing but the SDK to download?
That strange, I'm surprised if the jar jar plugin doesn't support it natively. You may give a try to the shade plugin which is also allowing to relocate classes and for sure it creates and deployed a modified pom for your artifact that won't expose your embedded dependencies to others projects using yours.
See :
http://maven.apache.org/plugins/maven-shade-plugin/examples/class-relocation.html
http://maven.apache.org/plugins/maven-shade-plugin/shade-mojo.html#createDependencyReducedPom
cheers

How can I automatically deploy a war from Nexus to Tomcat?

How can I automatically deploy a war from Nexus to Tomcat?
I have a maven web project which gets built and deployed (both SNAPSHOT and release versions) on Nexus successfully. I would like to know if there is feature/plugin in Nexus where it picks the released war and deploys on remote Tomcat automatically?
I know that you can deploy the war to remote Tomcat using maven-tomcat-plugin but would like to know if there is an alternative solution.
Please guide.
Typically you'd use a CI tool like Jenkins to run the Maven build that publishes your War file into Nexus. Nexus would then be used by whatever tool you're using to push the War onto the target tomcat environment:
There are lots and lots of options.
Jenkins post build SSH script
Run a post-build SSH task from Jenkins that does something like this on the target tomcat server:
curl "http://myrepo/nexus/service/local/artifact/maven/redirect?r=releases&g=myorg&a=myapp&v=1.1&e=war" \
-o /usr/local/share/tomcat7/webapps/myapp.war
service tomcat7 restart
Rundeck
My preference is to use Rundeck for deployments, because it has a Nexus plugin, providing convenient drop-down menus of available releases.
There is also a Rundeck plugin for Jenkins that can be used to orchestrate a CI process with Jenkins performing the build, hand-over to Rundeck for deployment, followed by a Jenkins call-back to run the integration tests.
Chef
I also use chef which can be used to automatically deploy software in a pull fashion.
The artifact cookbook has direct support for Nexus, whereas the application_java cookbook uses a more generic "pull from a URL" approach that also works well.
..
..
The list goes on, so I hope this helps.
We used UrbanCode for the deployment automation, retrieves war from Artifactory/Nexus and deploy to the target server.
I used the Nexus Rest-API, these endpoints downloads the artifact to Jenkins workspace.
In order to deploy Snapshot & Release to Tomcat we can create a Jenkins parameterized job and pass the parameters to the REST endpoint, also to deploy to a server like Tomact "Deploy WAR/EAR" Jenkins plugin will help.
We can parameterize the endpoint and use as part of "Build" step along with "Execute Shell script" option for the build.
wget --user=${UserName} --password=${Password} "http://192.168.49.131:8080/nexus/service/local/artifact/maven/redirect?r=releases&g=${GroupId}&a=${ArtifactId}&v=${Version}&e=${TypeOfArtifact}" --content-disposition
Actual endpoints to Nexus looks something like below.
wget --user=admin --password=admin123 "http://localhost:8080/nexus/service/local/artifact/maven/redirect?r=snapshots&g=org.codezarvis.artifactory&a=hushly&v=0.0.1-SNAPSHOT&e=jar" --content-disposition
wget --user=admin --password=admin123 "http://localhost:8080/nexus/service/local/artifact/maven/redirect?r=releases&g=org.codezarvis.artifactory&a=hushly&v=0.0.5&e=jar" --content-disposition
Thanks
-Sudarshan

Categories