JavaOne – Apache Maven and its Impact on Java 9

“Apache Maven and its Impact on Java 9”

Speaker: Robert Scholte

For more blog posts from JavaOne, see the table of contents


Up until Java 8, Maven goes fine on top of Java. In Java 9, there is overlap.

Review of Maven

  • Dependency management
  • All about pom.xml
  • All about classpaths
  • Generate project information

Module path mismatch

  • Classpath accepts – output dirs, jar files and zip files (Maven doesn’t support zip files)
  • Module path accepts output directories, module output directories and directories with jars [and jars; keep reading]
  • Options included pointing to diretory containing the jar (but contains other things to), symlins (windows unhappy), create lib directory and copy files (a lot of IO)
  • Java 9 team added specifying direct jar files per Maven’s request

Module names

  • Like problem with group id/artifact id
  • Need to be unique
  • Learned over 30K artifact ids end with a number. This was a problem for automatic module names because many woul have same name creating collision. ex: commons-lang2 and commons-lang3
  • Also, many artifact ids are naming conflicts if ignore group id. Which is problematic for automatic module names when use two jars that collide
  • Made difference between library builders and app builders. Standard that library builders should never refer to automatic modules. If no exports, can assume it is an application. And apps have control of what gets used.
  • Maven gives warning if library refers to automatic module usage. (use Maven 3.+ so warning shows up in color

Dependencies not yet modular

  • If you are dependent on open source library and it is dependent on one that isn’t modular (or the depenency changed the module name), the direct dependency can’t migrate to modules yet
  • Solution: use Automatic-Module-Name to manifest of libraries so not using algorithm. A good bridge

Tips

  • Point of no return – each time you refer to a dependency that is a module, you can’t go back to a previous version that does not
  • Don’t have split packages if can (Maven itself has a split package issue for old compatibility classes)
  • Don’t have classs in the root package
  • Provide your future module name in the manifest
  • Use a unique module name
  • Don’t change folder structure to add module name
  • plexus-java can help plugins build path
  • Classpath isn’t going away. The older the project, the harder it will likely be to migrate to modules

release tag
In addition to source/target 1.9, you can specify <release> to indicate compatiblity
Can use animal-sniffer to determine if code compiled on a newer version of Java in an older JDK mode will ctually run.

Module file
Maven doesn’t generate. Requires human input. Not all modules are dependencies. jdeps can do it because has access to binary files. But need before compile at build time so not compiling twice

My take: Interesting problems and solutions. I feel like he takeaway is “don’t upgrade to Java 9 yet”. The font was small on the screen. Even when there aren’t a lot of words on the screen

JavaOne – Escaping Developers’ Nightmares

“Escaping Developers’ Nightmares”

Speaker: Rustam Mehmandarov

For more blog posts from JavaOne, see the table of contents


Put together code tools and cs to make developer’s paradise.

90s – waterfall, java in notepad/emacs/vim, visual sourcesafe, cvs, javac at command line, MS Access in a shared network folder for defect tracking

now it is rainbows and unicorns – git, real issues tracking

Tweet from here:

YOU ARE IN A LEGACY CODEBASE

> RUN TESTS
YOU HAVE NO TESTS

> READ SPEC
YOU HAVE NO SPEC

> WRITE FIX
YOU ARE EATEN BY AN ELDER CODE HACK.

Continuous integration/deployment/delivery sold as unicorn or rocketship that will takes to stars.

Code quality

  • Code standard – do you have a coding standard? Do you follow it?
  • Encodign – If coding in langage other than English, do you have encoding standard? Is checking automated?
  • MIME Type – Do you have standard?
  • Code Reviews – Do you do? How know code does what supposed to?

Development Tools

  • Code Versioning – “Git or even SVN”. Do you have a branching and tagging strategy?
  • Complexity, Testing
  • Branching
  • Static code analysis
  • Plugins – ex: Sonar
  • IDEs, checks at comits, integrates with unit testing and sonarqube)
  • build tool – Jenkins, TeamCity, Bamboo, etc and Maven, Gradle, etc
  • Unit, integration, UI, end to end tests

Third party libraries

  • Do you track your third party libraries
  • Do you have known issues/vulnerablities
  • Are they updated? Are they maintained? Are they compatible with each other?
  • Are the licenses appropriate
  • Are they in Apache Attic? Where projects go to die
  • Google OSS Fuzz test

Packaging > Delivery > Deploy

  • Automated deployment?
  • What environments can you deploy to?
  • Are enviornment similar
  • Same process to deploy to each environment
  • Do QA and Prod use separate physical hardware
  • How easy to rebuild from a script
  • Do you have monitoring in all environments

Architecture

  • Do you support continous deploy? Microservices? Load balancing?
  • Code package structure can hurt or help you

Helpful Maven plugins
Assembly, versions, depedency, enforcer surefire, failsafe, sonar, findbugs, pmd

Documentation

  • Wiki
  • Avoid multiple documentation systems

Collaboration

  • Issue tracking
  • Wiki
  • Chat

Blog post on bash ools:
https://mehmandarov.com/cmd-tools-for-developers/

My take: Fun comparison. He even drew a unicorn with rainbow hair and a rainbow tail for the “rainbows and unicorns” slide. A lot of things were covered. And if you know you are supposed to do them, definitely a good review/checklist. There were a few stories. I was hoping for more stories or more on how to sell the need for such tools. [Someone asked about how to sell and he said “you just have to explain it and show the value.” I thought how would be in the talk”]

JavaOne – Disrupting Engineering Education

“Disprupting Engineering Education; Hello from 42”

Speaker: Tony Hendrick, Oleksandra Fedorova & Giacomo Guiulfo

For more blog posts from JavaOne, see the table of contents


https://www.42.us.org

42 Silicon Valley

  • tuition free coding school
  • no teachers
  • no classes
  • when start – can only communicate by Slack
  • the application process starts with two logic games with no instructions. The first test involves memory. If you pass, you get an email with the next steps
  • Then comes the piscine a 4 week crash course in C with daily peer reviewed exercises. Each weekend get an individual and group project. 10-15 hours a day for 28 days. Then whatever want; most students choose 8-10 hour days
  • Staff doesn’t answer questions. They tell you to ask other students. 250-300 students
  • 3-5 year program. Twenty one levels to go through. Self paced
  • Start with writing a C library then can choose branch working with 4 other people
  • high school diploma required only if under 18
  • Supplement with other resources. ex: coursera
  • Buiding open 24×7 so can work when want. Must be in person for tests, grading, etc. Want to build face to face skils for office
  • Learn many languages
  • Must do coding internship after a year. Can pause account if get offer or contract job (or family suitation)
  • Funded by philanthropist
  • Grading is pass/fail. If a tiny bit wrong, still fail
  • Paris campus opened in 2013 and US campus opened in 2016. Also have satelitte campuses in a few countries

Branch choices

  • unix – to become systems programmer – make unix commands, shell
  • graphics – math heavy, fractals
  • algorithms – rebuild common algorithms from scratch and then projects

Example Projects

  • Reimplment printf
  • C++ crash course (in a crash course a project is due every 2 days for 2 weeks
  • Mock interviews – algorithms on whiteboard

Staff
10 full time staff
600 students
1024 computers
staff create opportunities – ex: book room for club

Learning Techniques

  • Active learning – few instructions so figure it out
  • Learning through explaining to others
  • Ability to adapt, research ability, speed
  • Randomized team vs choose a team depending on project

42 Embassadors
Volunteer – demos, registration desk at this conference, etc

My take: Interesting approach to learning and building a community of learners. This sounds way better than what the coding bootcamps are trying to do.