Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add maven back & front build integration #65

Merged
merged 1 commit into from
Jan 30, 2017

Conversation

MatiasComercio
Copy link
Owner

@MatiasComercio MatiasComercio commented Jan 30, 2017

Summary

  • Add frontend-maven-plugin
  • Add url path mandatory parameter on both maven package
    and grunt build processes
  • Add 'dist' directory (front build folder) to war file
    • This was accomplished by adding this folder to the maven package
      lifecycle
  • Fix Spring filter to match API paths only (/api/v1/*)
    • Frontend filter will be done with frontend tools
  • Update Gruntfile.js
    • Update jsrev task to load requirejs components (controllers,
      services and directives) based on the specified path where the app
      will be deployed (for example, '/' or '/grupo1')
    • Fix some Gruntfile issues
    • Requirejs module packager not updated. See Notes (2) for more information
  • Update views paths on both routes.js and directives' templateUrl field
    • Update absolute paths ('/views/home.html') to relative paths
      ('views/home.html')
  • Update karma configuration file
    • Genereate symlink inside app's folder pointing to bower_components
      folder when running karma start. See Notes (1) for more information
  • Update README.md
  • Fix logger
    • It was on DEBUG level. jpascale changed this and mmercado approved
      its PR. We have to be careful about this changes.
  • Update WebConfig parameters for stage deploy
  • Exclude dependency from main's pom
    • This dependency is excluded to avoid the following warning from the
      Tomcat server:
      INFO:validateJarFile(/home/matias/Programs/apache-tomcat-7.0.68/
      webapps/grupo1/WEB-INF/lib/javax.el-api-2.2.4.jar)- jar not loaded.
      See Servlet Spec 3.0, section 10.7.2.
      Offending class:javax/el/Expression.class

Notes

(1) Genereate symlink inside app's folder pointing to bower_components
folder when running karma start.

Why do we need this?
basePath is used as a starting path for all other paths inside this
config file.
For example, with the following config
basePath: 'app', files: [{pattern: index.js}, {pattern: ../other.js}],
port: 9876
the files that will be match will be
'<project_path>/app/index.html'
'<project_path>/other.html'

However, the files will be served as:
http://localhost:9876/base/index.js
http://localhost:9876/absolute/absoultePathToProject/other.js

Due to we need to set basePath to 'app' to be able to test directives
with templateUrl,
and to avoid the case of the 'other.js' example of above with
bower_components, we need
to make reference to the bower_components folder somehow.
This 'somehow' was resolved to be a symlink.

(2) Requirejs module packager not updated

Test setting Gruntfile.js's requirejs:compile:options:modules also
with the following values:
{name:'controllers/BodyCtrl'},
{name: 'controllers/HomeCtrl'},
{name: 'controllers/LoginCtrl'}
so as to compress all related files. However, this was causing some
.js files to be merged with all of this files (like angular.js)
and this increased each of these files sizes, doing the contrary
effect that it was being looked for (speed up loading time).

That's why it was decided to left the Gruntfile.js as it was.

Trello Cards

Copy link
Owner Author

@MatiasComercio MatiasComercio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just this :D

@@ -13,6 +13,8 @@ module.exports = function (grunt) { // eslint-disable-line strict
dist: 'dist'
};

var baseUrlPrefix;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not used. Remove it.

- Add frontend-maven-plugin
- Add url path mandatory parameter on both maven package
  and grunt build processes
- Add 'dist' directory (front build folder) to war file
  - This was accomplished by adding this folder to the maven package
    lifecycle
- Fix Spring filter to match API paths only (/api/v1/*)
  - Frontend filter will be done with frontend tools
- Update Gruntfile.js
  - Update jsrev task to load requirejs components (controllers,
    services and directives) based on the specified path where the app
    will be deployed (for example, '/' or '/grupo1')
  - Fix some Gruntfile issues
  - Requirejs module packager not updated. See Notes (2) for more information
- Update views paths on both routes.js and directives' templateUrl field
  - Update absolute paths ('/views/home.html') to relative paths
    ('views/home.html')
- Update karma configuration file
  - Genereate symlink inside app's folder pointing to bower_components
    folder when running `karma start`. See Notes (1) for more information
- Update README.md
- Fix logger
  - It was on DEBUG level. jpascale changed this and mmercado approved
    its PR. We have to be careful about this changes.
- Update WebConfig parameters for stage deploy
- Exclude dependency from main's pom
  - This dependency is excluded to avoid the following warning from the
    Tomcat server:
       INFO:validateJarFile(/home/matias/Programs/apache-tomcat-7.0.68/
       webapps/grupo1/WEB-INF/lib/javax.el-api-2.2.4.jar)- jar not loaded.
       See Servlet Spec 3.0, section 10.7.2.
       Offending class:javax/el/Expression.class

Notes:
(1) Genereate symlink inside app's folder pointing to bower_components
    folder when running `karma start`.

Why do we need this?
basePath is used as a starting path for all other paths inside this
config file.
For example, with the following config
  basePath: 'app', files: [{pattern: index.js}, {pattern: ../other.js}],
port: 9876
the files that will be match will be
  '<project_path>/app/index.html'
  '<project_path>/other.html'

However, the files will be served as:
   http://localhost:9876/base/index.js
   http://localhost:9876/absolute/absoultePathToProject/other.js

Due to we need to set basePath to 'app' to be able to test directives
with templateUrl,
and to avoid the case of the 'other.js' example of above with
bower_components, we need
to make reference to the bower_components folder somehow.
This 'somehow' was resolved to be a symlink.

(2) Requirejs module packager not updated

Test setting Gruntfile.js's requirejs:compile:options:modules also
with the following values:
  {name:'controllers/BodyCtrl'},
  {name: 'controllers/HomeCtrl'},
  {name: 'controllers/LoginCtrl'}
so as to compress all related files. However, this was causing some
.js files to be merged with all of this files (like angular.js)
and this increased each of these files sizes, doing the contrary
effect that it was being looked for (speed up loading time).

That's why it was decided to left the Gruntfile.js as it was.
@MatiasComercio MatiasComercio merged commit 9c9fd70 into development Jan 30, 2017
@MatiasComercio MatiasComercio deleted the build-configuration branch January 30, 2017 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant