More Related Content Similar to What a Back-end Java Developer Doesn't Know About the Modern Web Stack-final Similar to What a Back-end Java Developer Doesn't Know About the Modern Web Stack-final (20) More from Rikard Thulin (6) What a Back-end Java Developer Doesn't Know About the Modern Web Stack-final1. What a Back-end
Java Developer
Doesn't Know About the Modern Web Stack
Peter Lindh @peterlindh
Rikard Thulin @rikard_thulin
3. All names, characters, and incidents portrayed in this presentation are fictitious.
No identification with actual persons is intended or should be inferred.
15. Java Developer Web Developer
Image from http://nighthacks.com
Ecological Green TeaStarbucks Coffee
5th
45. modernweb
|-- pom.xml
`-- src/
|-- main/
| `-- resources/
| `-- images/
| `-- duke.png
`-- webapp/
|-- WEB-INF/
| `-- web.xml
|-- css/
| `-- modern.css
|-- index.html
49. modernweb
|-- pom.xml
`-- src/
|-- main/
| `-- resources/
| `-- images/
| `-- duke.png
`-- webapp/
|-- WEB-INF/
| `-- web.xml
|-- css/
| `-- modern.css
|-- index.html
target/modernweb
|-- css/
| `-- modern.css
|-- images/
| `-- duke.png
|-- index.html
|-- WEB-INF/
`-- web.xml
Maven to
war layout
50. modernweb
|-- pom.xml
`-- src/
|-- main/
| `-- resources/
| `-- images/
| `-- duke.png
`-- webapp/
|-- WEB-INF/
| `-- web.xml
|-- css/
| `-- modern.css
|-- index.html
target/modernweb
|-- css/
| `-- modern.css
|-- images/
| `-- duke.png
|-- index.html
|-- WEB-INF/
`-- web.xml
Images are
resources
51. modernweb
|-- pom.xml
`-- src/
|-- main/
| `-- resources/
| `-- images/
| `-- duke.png
`-- webapp/
|-- WEB-INF/
| `-- web.xml
|-- css/
| `-- modern.css
|-- index.html
target/modernweb
|-- css/
| `-- modern.css
|-- images/
| `-- duke.png
|-- index.html
|-- WEB-INF/
`-- web.xml
Images are
resources
LOL
52. modernweb
|-- pom.xml
`-- src/
|-- main/
| `-- resources/
| `-- images/
| `-- duke.png
`-- webapp/
|-- WEB-INF/
| `-- web.xml
|-- css/
| `-- modern.css
|-- index.html
target/modernweb
|-- css/
| `-- modern.css
|-- images/
| `-- duke.png
|-- index.html
|-- WEB-INF/
`-- web.xml
Ok, IRL
images goto
webapp
53. target/modernweb
|-- css/
| `-- modern.css
|-- images/
| `-- duke.png
|-- index.html
|-- WEB-INF/
`-- web.xml
war layout
to war
binary
WAR
target/modernweb.war
55. We serve files
It’s as simple as that!
|-- images/
| `-- duke.png
|-- css/
| `-- modern.css
|-- index.html
59. modernweb
|-- pom.xml
`-- src/
|-- main/
| `-- resources/
| `-- images/
| `-- duke.png
`-- webapp/
|-- WEB-INF/
| `-- web.xml
|-- js/
| `-- jquery-3.1.0.min.js
|-- index.html
63. modernweb
|-- pom.xml
`-- src/
|-- main/
| `-- resources/
| `-- images/
| `-- duke.png
`-- webapp/
|-- WEB-INF/
| `-- web.xml
|-- js/
| `-- jquery-3.1.0.min.js
| jquery-3.1.1.min.js
| jquery-3.1.1.min.map
| jquery-3.1.1.js
|-- index.html
$ rm jquery-3.1.0.min.js
65. Why do I put
dependencies
under
Version Control
System?
modernweb
|-- pom.xml
`-- src/
|-- main/
| `-- resources/
| `-- images/
| `-- duke.png
`-- webapp/
|-- WEB-INF/
| `-- web.xml
|-- js/
| `-- jquery-3.1.1.min.js
| jquery-3.1.1.min.map
| jquery-3.1.1.js
|-- index.html
68. { why it is different }
Add dependencies
79. But npm3 has flat dependencies
While npm2 installs all dependencies in a nested
way, npm3 tries to mitigate the deep trees and
redundancy that such nesting causes. npm3
attempts this by installing some secondary
dependencies (dependencies of dependencies)
in a flat way...
TL;DR
npm v3 Dependency Resolution [https://docs.npmjs.com/how-npm-works/npm3]
91. Dep
App
DepDep Dep
DepDep Dep Dep
DepDep Dep DepDep
Nested dependencies
Dependency
App
Flat dependencies
When size does
matter
{ web, css, fonts }
BOWER
When size does not
matter
{ java, tooling, modules }
MAVEN, NPM
97. Task runners automate everything
that can be automated
compile css/sass, optimize images, minification,
software verification
100. Maven plugin ~= grunt / gulp plugin
Maven build phase ~= grunt task
Gradle task ~= gulp task
~= != =
118. $ mvn clean install
F5
$ mvn tomcat:run
Duke
#something {
background: papayawhip;
}
124. { why it is different }
Development Workflow
132. mvn install mvn deploy
CI build artifact integration test
performance test publish artifact
build container publish container
deploy container preview
147. THE FUTURE MAY BE…
As Yeoman beats maven archetypes
<ironic>
In the future
node is required to create a java project
</ironic>
148. TIP OF THE DAY
About to develop a maven archetype?
Is it the right tool?
Have you evaluated Yeoman?
150. Maven plugins ~= grunt / gulp
Maven plugins ~= npm
Maven life cycles ~= grunt
Maven dependencies ~= bower
Maven archetypes = yo
166. Your mission if you choose to accept it
EXPERIMENT
WE RECOMMEND THE EASY WAY
167. Q & A
Peter Lindh Rikard Thulin
@peterlindh @rikard_thulin