Heroku & Maven & Java dynamic web project

thready
thready used Ask the Experts™
on
Hi Experts,

I created a new java dynamic web project and got it going.  Now I'm trying to deploy to Heroku.

It's saying "Push rejected, failed to detect set buildpack heroku/java" when I "git push heroku master".

I assume it's because I don't have a pom.xml file and I'm not using Maven.  All I know about Mavan is it's something that helps build webapps.

I think these are my options to get this working:
- deploy Heroku's sample application and pull stuff out of my app and insert it into the sample app (that I'm able to deploy)
- fix my webapp to work with Heroku.

What's my best option - or if you can give further pointers, I'd very much appreciate!

Thanks!
Mike
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
IT Business Systems Analyst / Software Developer
Top Expert 2015
Commented:
I assume it's because I don't have a pom.xml file and I'm not using Maven.  All I know about Mavan is it's something that helps build webapps.

That's correct, it needs Maven to compile your app. By the way, Maven is not just for we apps, it helps in building many types of app.

Personally, I think it would be good for you to know more about Maven. It will help for this but also many of your previous questions would see the benefit of a little knowledge and experience with Maven.

Author

Commented:
Thanks Mccarl, I'll read what I can.  I'm in a rush to get something out the door for tomorrow morning, so if there's any quick hints I'd sincerely appreciate it!
mccarlIT Business Systems Analyst / Software Developer
Top Expert 2015

Commented:
if there's any quick hints I'd sincerely appreciate it!

Firstly, I'd probably suggest NOT to "read what you can" but to DO something instead. Start a basic standalone Maven project (most IDE's should have an option for this) and get an idea of the directory structure and the basic parts of the pom.xml file. Then add ONE dependency, something simple such as apache commons io or something and write the simplest Java standalone app that uses the library. Get a feel for what it does and how it makes it different to what you would normally do if you were to use this library (eg. locate on the web, download, unzip, put it somewhere, add it to your build path, etc).

Now, even for your webapp, you shouldn't need to delve into too much of the secrets of Maven. Use it to define the dependencies of your webapp, and have it build your "war" file. Once you have it working locally, deploying to Heroku should then be not too much of a drama. Yes, Maven can do a LOT of things for you, but in this case you should only NEED the basics.

And obviously, if you get stuck on anything, you can post here! ;)

Author

Commented:
If I didn't have to do 10000 other things tonight I'd definitely take that great advice!  Trust me, it's exactly what I would have done....

Now I'm just trying to get my hands on a server.xml file for tomcat to run in http only....

I will hit Maven hard in about a week...

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial