Why IntelliJ Wouldn’t Import My Maven Dependencies

I had my first introduction to PHPStorm five years ago now, and I’ve become a huge fan of JetBrains IDEs. In fact, I currently have four installed on my main development machine – PHPStorm, RubyMine, PyCharm and IntelliJ.

Recently I had my first taste of Maven. The other developers on the project told me that IntelliJ has great support for Maven so I was frustrated when two hours later I still hadn’t worked out how to get it to download the project’s dependencies. I was greeted with a sea of red every time I opened a class file. My first two attempts at clearing this involved selecting Build -> Make from the menu bar, or clicking the “Reimport All Maven Projects” button on the Maven toolbar, but after trying these several times each I was stumped.

By running mvn compile on the command line (or even from IntelliJ’s Maven toolbar), I was able to download the dependencies into my local repository. The sea of red persisted though, until I manually added them all onto my classpath in IntelliJ’s Project Structure dialog. Yuck!

For once my Google fu failed me. Stack Overflow wasn’t a lot of help. The IntelliJ community forums had a few questions on this page, but by following all of the random suggestions I managed to muck up my project settings so royally I decided to chuck them out and start again.

And that was when I figured it out. After selecting New -> Project from Existing Sources, I took a proper look at this dialog:

Notice the third option in that greyed-out list there? Turns out that sometimes trusting your IDE’s default options is not the right strategy. When I selected “Import project from external model” and Maven, everything “just worked” and IntelliJ pulled in all my dependencies and put them on the classpath for me. No more red!

Advice to Grads

Yesterday Stuff published an article about a shortage of internship and graduate opportunities for students in the IT sector. This backs up an NZTech update last week about a shortage of internships, with fewer than 10% of the students who registered for Summer of Tech actually getting a placement.

Back in my day I had a charmed ride into employment. I went to a couple of career fairs at uni and gave my CV to the cool stalls there, but nobody ever got back to me. I didn’t really take job hunting seriously until suddenly I had a letter in the mail, congratulating me on completing my degree. I sat down to look at Seek that afternoon, applied to the first grad job I found, and had an offer within two weeks.

Job hunting has never been that easy for me since. I have some experience now from both sides of the table, and here is my advice for students or grads who are looking to start a career in software development:

Do something to demonstrate that you are competent and passionate, and tell potential employers about it.

That’s it. The “something” can be just about anything that involves working with or talking about technology. It doesn’t have to be one ongoing Great Big Thing that you spend hours on every week or even every month – ideally you would do a little bit regularly, but obviously during your semester most of your energy is going to be tied up in your coursework. Just take your opportunities where you find them – the extra time after all of your papers’ exams were in the same week, the bonus day off when your lecturers go on strike, the time you sprained your ankle and couldn’t work at your retail job for a week. If you have a tedious non-techy job over the summer break because you couldn’t get an internship, set aside a few hours on your day off to go into more depth in something that interests you.

  • Pick a new language or framework that wasn’t covered in your coursework, work through the tutorials, and build a simple app. For maximum effect take a look at Seek first, to make sure that there is demand for junior and intermediate developers with that skill. Struggle and swear and frantically Google error messages until it works. Push your work to Github frequently as you go, warts and all. When you’re done, do a Google search for “<language> coding style” and go through your code to make it look more like that.
  • Write a blog where you talk about what you’ve been learning and doing (cough cough), or run a Twitter handle where you share stuff that other people have been writing. On that note, keeping up with the most popular blogs about the particular stack that you finish up working on is a vital part of being a developer. Not sure where to start? Follow the official Twitter accounts for a couple of languages and frameworks, and let the retweets and the recommendation engine lead you to other influencers.
  • Participate actively in StackOverflow, rather than just passively consuming its pearls of wisdom when you can’t get your thing to work. Pick a couple of tags and browse the new question feed regularly, which will open your eyes to a whole slew of things you didn’t know you didn’t know. One day you might see a question that you think you know the answer to – jump on this opportunity! It can be hard to get started because most people on there know more than you, but most of your fellow grads won’t have a StackOverflow profile so even 20 points will help you stand out.
  • Participate in open-source software. This advice is often thrown around and it sounds vague and scary, but just keep an eye out for little things that you can contribute. If you are taking the official tutorial and there’s something that’s a bit unclear, find out how to raise a pull request to improve the wording. Explore the tickets in your favourite framework’s Github repo and see if there are any labelled as being beginner-friendly. Look around in the source files to see if you can figure out how things work, and consider raising a PR to improve the comments if one bit seems more confusing than the other bits.
  • Look up the local tech meetups on meetup.com and pick a couple to go along to. The careers advice from my uni stressed that networking was Very Very Important, but never gave us any useful advice on how to actually get started. This is how. You’ll learn heaps by listening and most people will be happy to dish out advice or business cards. Bonus points if you can find someone who will look over your code and give you some pointers.
  • Sometimes you will feel the urge to build a wee something to solve a problem that you encounter in the real world. Do it, and push it to Github regularly as you go. It doesn’t matter that the problem is very small or that the solution is rather crude … you made a thing, all by yourself, with your own initiative and knowledge and determination not to be thwarted by a computer.
  • If you can find a Startup Weekend near you on a date that won’t interfere with your coursework, leap at this opportunity. Don’t worry that you don’t have the faintest clue how to get started – there will be more experienced devs there, and the opportunity to work alongside them and get their input on your coding habits is so valuable.

And once you’ve done a couple of these things, don’t forget to talk about this stuff in your CV. Put a link to your Github account or StackOverflow profile next to your contact details. Describe the projects that you are proudest of, both from your coursework and the dirty wee app you that resolved an argument about how much each flatmate should chip in for the power. Whack in a Groups and Clubs section where you can mention any meetup groups that you go to.

Congratulations. You have now done enough to distinguish yourself from 80% of the applicants for that grad job you’re going for. Your CV won’t be going straight into the rubbish bin, and your prospects now depend more on your skills than on luck. May the odds be ever in your favour!