kandi background
Explore Kits

frontend-maven-plugin | Maven plugin that downloads/installs Node and NPM locally | DevOps library

 by   eirslett Java Version: Current License: Apache-2.0

 by   eirslett Java Version: Current License: Apache-2.0

Download this library from

kandi X-RAY | frontend-maven-plugin Summary

frontend-maven-plugin is a Java library typically used in Devops, Nodejs, NPM, Maven, Gulp applications. frontend-maven-plugin has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has high support. You can download it from GitHub, Maven.
"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins." A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • frontend-maven-plugin has a highly active ecosystem.
  • It has 3622 star(s) with 780 fork(s). There are 128 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 231 open issues and 464 have been closed. On average issues are closed in 311 days. There are 48 open pull requests and 0 closed requests.
  • It has a negative sentiment in the developer community.
  • The latest version of frontend-maven-plugin is current.
This Library - Support
Best in #DevOps
Average in #DevOps
This Library - Support
Best in #DevOps
Average in #DevOps

quality kandi Quality

  • frontend-maven-plugin has 0 bugs and 0 code smells.
This Library - Quality
Best in #DevOps
Average in #DevOps
This Library - Quality
Best in #DevOps
Average in #DevOps

securitySecurity

  • frontend-maven-plugin has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • frontend-maven-plugin code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
This Library - Security
Best in #DevOps
Average in #DevOps
This Library - Security
Best in #DevOps
Average in #DevOps

license License

  • frontend-maven-plugin is licensed under the Apache-2.0 License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
This Library - License
Best in #DevOps
Average in #DevOps
This Library - License
Best in #DevOps
Average in #DevOps

buildReuse

  • frontend-maven-plugin releases are not available. You will need to build from source code and install.
  • Deployable package is available in Maven.
  • Build file is available. You can build the component from source.
  • Installation instructions, examples and code snippets are available.
  • frontend-maven-plugin saves you 1774 person hours of effort in developing the same functionality from scratch.
  • It has 4443 lines of code, 334 functions and 80 files.
  • It has medium code complexity. Code complexity directly impacts maintainability of the code.
This Library - Reuse
Best in #DevOps
Average in #DevOps
This Library - Reuse
Best in #DevOps
Average in #DevOps
Top functions reviewed by kandi - BETA

kandi has reviewed frontend-maven-plugin and discovered the below as its top functions. This is intended to give you an instant insight into frontend-maven-plugin implemented functionality, and help decide if they suit your requirements.

  • Extracts the contents of an archive to a destination directory .
  • Install the default cache .
  • Installs pnpm .
  • Installs the given npm version .
  • Installs YAR .
  • Parses the command line arguments .
  • Creates the list of npm arguments for the given proxy configuration .
  • Creates and returns a list of arguments based on the provided configuration .
  • Download a file to a destination
  • mask the password

frontend-maven-plugin Key Features

"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins." A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.

Installation

copy iconCopydownload iconDownload
<plugins>
    <plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
        <!-- Use the latest released version:
        https://repo1.maven.org/maven2/com/github/eirslett/frontend-maven-plugin/ -->
        <version>LATEST_VERSION</version>
        ...
    </plugin>
...

Installing node and npm

copy iconCopydownload iconDownload
<plugin>
    ...
    <executions>
        <execution>
            <!-- optional: you don't really need execution ids, but it looks nice in your build log. -->
            <id>install node and npm</id>
            <goals>
                <goal>install-node-and-npm</goal>
            </goals>
            <!-- optional: default phase is "generate-resources" -->
            <phase>generate-resources</phase>
        </execution>
    </executions>
    <configuration>
        <nodeVersion>v4.6.0</nodeVersion>

        <!-- optional: with node version greater than 4.0.0 will use npm provided by node distribution -->
        <npmVersion>2.15.9</npmVersion>
        
        <!-- optional: where to download node and npm from. Defaults to https://nodejs.org/dist/ -->
        <downloadRoot>http://myproxy.example.org/nodejs/</downloadRoot>
    </configuration>
</plugin>

Installing node and yarn

copy iconCopydownload iconDownload
<plugin>
    ...
    <execution>
        <!-- optional: you don't really need execution ids, but it looks nice in your build log. -->
        <id>install node and yarn</id>
        <goals>
            <goal>install-node-and-yarn</goal>
        </goals>
        <!-- optional: default phase is "generate-resources" -->
        <phase>generate-resources</phase>
    </execution>
    <configuration>
        <nodeVersion>v6.9.1</nodeVersion>
        <yarnVersion>v0.16.1</yarnVersion>

        <!-- optional: where to download node from. Defaults to https://nodejs.org/dist/ -->
        <nodeDownloadRoot>http://myproxy.example.org/nodejs/</nodeDownloadRoot>
        <!-- optional: where to download yarn from. Defaults to https://github.com/yarnpkg/yarn/releases/download/ -->
        <yarnDownloadRoot>http://myproxy.example.org/yarn/</yarnDownloadRoot>        
    </configuration>
</plugin>

Running npm

copy iconCopydownload iconDownload
<execution>
    <id>npm install</id>
    <goals>
        <goal>npm</goal>
    </goals>

    <!-- optional: default phase is "generate-resources" -->
    <phase>generate-resources</phase>

    <configuration>
        <!-- optional: The default argument is actually
        "install", so unless you need to run some other npm command,
        you can remove this whole <configuration> section.
        -->
        <arguments>install</arguments>
    </configuration>
</execution>

Running yarn

copy iconCopydownload iconDownload
<execution>
    <id>yarn install</id>
    <goals>
        <goal>yarn</goal>
    </goals>
    <configuration>
         <!-- optional: The default argument is actually
         "install", so unless you need to run some other yarn command,
         you can remove this whole <configuration> section.
         -->
        <arguments>install</arguments>
    </configuration>
</execution>

Running bower

copy iconCopydownload iconDownload
<execution>
    <id>bower install</id>
    <goals>
        <goal>bower</goal>
    </goals>

    <configuration>
        <!-- optional: The default argument is actually
        "install", so unless you need to run some other bower command,
        you can remove this whole <configuration> section.
        -->
        <arguments>install</arguments>
    </configuration>
</execution>

Running Grunt

copy iconCopydownload iconDownload
<execution>
    <id>grunt build</id>
    <goals>
        <goal>grunt</goal>
    </goals>

    <!-- optional: the default phase is "generate-resources" -->
    <phase>generate-resources</phase>

    <configuration>
        <!-- optional: if not specified, it will run Grunt's default
        task (and you can remove this whole <configuration> section.) -->
        <arguments>build</arguments>
    </configuration>
</execution>

Running gulp

copy iconCopydownload iconDownload
<execution>
    <id>gulp build</id>
    <goals>
        <goal>gulp</goal>
    </goals>

    <!-- optional: the default phase is "generate-resources" -->
    <phase>generate-resources</phase>

    <configuration>
        <!-- optional: if not specified, it will run gulp's default
        task (and you can remove this whole <configuration> section.) -->
        <arguments>build</arguments>
    </configuration>
</execution>

Running jspm

copy iconCopydownload iconDownload
<execution>
    <id>jspm install</id>
    <goals>
        <goal>jspm</goal>
    </goals>

    <configuration>
	    <!-- optional: The default argument is actually
	    "install", so unless you need to run some other jspm command,
	    you can remove this whole <configuration> section.
	    -->
        <arguments>install</arguments>
    </configuration>
</execution>

Running Karma

copy iconCopydownload iconDownload
<execution>
    <id>javascript tests</id>
    <goals>
        <goal>karma</goal>
    </goals>

    <!-- optional: the default plase is "test". Some developers
    choose to run karma in the "integration-test" phase. -->
    <phase>test</phase>

    <configuration>
        <!-- optional: the default is "karma.conf.js" in your working directory -->
        <karmaConfPath>src/test/javascript/karma.conf.ci.js</karmaConfPath>
    </configuration>
</execution>

Running Webpack

copy iconCopydownload iconDownload
<execution>
    <id>webpack build</id>
    <goals>
        <goal>webpack</goal>
    </goals>

    <!-- optional: the default phase is "generate-resources" -->
    <phase>generate-resources</phase>

    <configuration>
        <!-- optional: if not specified, it will run webpack's default
        build (and you can remove this whole <configuration> section.) -->
        <arguments>-p</arguments>
    </configuration>
</execution>

Optional Configuration

copy iconCopydownload iconDownload
<plugin>
    <groupId>com.github.eirslett</groupId>
    <artifactId>frontend-maven-plugin</artifactId>

    <!-- optional -->
    <configuration>
        <workingDirectory>src/main/frontend</workingDirectory>
    </configuration>
</plugin>

Spring boot with react url not found issue

copy iconCopydownload iconDownload
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Override
    public void addViewControllers(ViewControllerRegistry registry){
        registry.addViewController("/{spring:\\w+}")
                .setViewName("forward:/");
        registry.addViewController("/**/{spring:\\w+}")
                .setViewName("forward:/");
        registry.addViewController("/{spring:\\w+}/**{spring:?!(\\.js|\\.css)$}")
                .setViewName("forward:/");
    }
}

Spring boot API and React js running on Tomcat

copy iconCopydownload iconDownload
const API_ROOT = '/webfolder/api'

useEffect(() => {
  axios.get(`${API_ROOT}/spaces`).then(...).catch(...)
  axios.get(`${API_ROOT}/categories`).then(...).catch(...)
})

Cannot load static file in tomcat

copy iconCopydownload iconDownload
module.exports = {
  publicPath: process.env.NODE_ENV === 'production'
    ? '/report_system-1.0/'
    : '/'
}

Adding angular as maven module in maven project

copy iconCopydownload iconDownload
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <maven.deploy.skip>true</maven.deploy.skip>
    </properties>


    <build>
        <plugins>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>npm install</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>install</phase>
                        <configuration>
                            <executable>npm</executable>
                            <arguments>
                                <argument>install</argument>
                            </arguments>
                        </configuration>
                    </execution>
                    <execution>
                        <id>npm build</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <phase>install</phase>
                        <configuration>
                            <executable>npm</executable>
                            <arguments>
                                <argument>run</argument>
                                <argument>build</argument>
                            </arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

        </plugins>
    </build>
-----------------------
 <workingDirectory>src/main/web/</workingDirectory>
<workingDirectory>frontend-module/src/main/web/</workingDirectory>
-----------------------
 <workingDirectory>src/main/web/</workingDirectory>
<workingDirectory>frontend-module/src/main/web/</workingDirectory>

Jhipster Gateway Ubuntu - Blank Page Angular

copy iconCopydownload iconDownload
{
  "name": "services",
  "version": "0.0.0",
  "description": "Description for services",
  "private": true,
  "license": "UNLICENSED",
  "cacheDirectories": [
    "node_modules"
  ],
  "dependencies": {
    "@angular/animations": "6.0.0",
    "@angular/cdk": "^6.3.0-10",
    "@angular/common": "6.0.0",
    "@angular/compiler": "6.0.0",
    "@angular/core": "6.0.0",
    "@angular/forms": "6.0.0",
    "@angular/platform-browser": "6.0.0",
    "@angular/platform-browser-dynamic": "6.0.0",
    "@angular/router": "6.0.0",
    "@fortawesome/angular-fontawesome": "0.1.1",
    "@fortawesome/fontawesome-svg-core": "1.2.0",
    "@fortawesome/free-solid-svg-icons": "5.1.0-8",
    "@ng-bootstrap/ng-bootstrap": "2.0.0",
    "@stomp/ng2-stompjs": "^4.0.0",
    "angular-file-saver": "^1.1.3",
    "angular2-highlight-js": "^6.0.1-alpha",
    "angular2-loaders-css": "^2.0.1",
    "angular2-prettyjson": "^3.0.1",
    "bootstrap": "^4.3.1",
    "bpmn-js": "^1.3.3",
    "bpmn-js-properties-panel": "^0.24.2",
    "chart.js": "^2.7.2",
    "chartjs-plugin-annotation": "file:node_local_patches/chartjs-plugin-annotation",
    "core-js": "2.5.3",
    "file-saver": "^1.3.8",
    "jquery": "3.3.1",
    "json-loader": "^0.5.7",
    "lodash": "^4.17.5",
    "moment": "2.21.0",
    "ng-jhipster": "0.5.3",
    "ng2-charts-x": "file:node_local_patches/ng2-charts-x",
    "ng2-validation": "^4.2.0",
    "ng4-loading-spinner": "^1.1.3",
    "ngx-cookie": "2.0.1",
    "ngx-infinite-scroll": "0.5.1",
    "ngx-tooltip": "0.0.9",
    "ngx-webstorage": "2.0.1",
    "node-sass": "^4.13.1",
    "popper.js": "^1.14.3",
    "reflect-metadata": "0.1.12",
    "rxjs": "6.1.0",
    "rxjs-compat": "6.1.0",
    "sockjs-client": "1.1.4",
    "swagger-ui": "2.2.10",
    "tslib": "1.9.0",
    "video.js": "^7.6.5",
    "videojs-flash": "^2.1.0",
    "webstomp-client": "1.2.0",
    "zone.js": "0.8.26"
  },
  "devDependencies": {
    "@angular/cli": "6.0.0",
    "@angular/compiler-cli": "6.0.0",
    "@ngtools/webpack": "6.0.0",
    "@types/jest": "22.2.3",
    "@types/node": "9.4.7",
    "angular-router-loader": "0.8.2",
    "angular2-template-loader": "0.6.2",
    "browser-sync": "2.24.4",
    "browser-sync-webpack-plugin": "2.2.2",
    "cache-loader": "1.2.2",
    "codelyzer": "4.2.1",
    "copy-webpack-plugin": "4.5.1",
    "css-loader": "0.28.10",
    "exports-loader": "0.7.0",
    "extract-text-webpack-plugin": "4.0.0-beta.0",
    "file-loader": "1.1.11",
    "fork-ts-checker-webpack-plugin": "0.4.1",
    "generator-jhipster": "5.0.0",
    "html-loader": "0.5.5",
    "html-webpack-plugin": "3.2.0",
    "husky": "0.14.3",
    "jest": "22.4.3",
    "jest-preset-angular": "5.2.2",
    "jest-sonar-reporter": "2.0.0",
    "lint-staged": "7.0.0",
    "moment-locales-webpack-plugin": "1.0.5",
    "postcss-loader": "2.1.1",
    "prettier": "1.11.1",
    "proxy-middleware": "0.15.0",
    "raw-loader": "0.5.1",
    "rimraf": "2.6.1",
    "sass-loader": "7.0.1",
    "style-loader": "0.20.3",
    "tapable": "1.0.0",
    "thread-loader": "1.1.5",
    "to-string-loader": "1.1.5",
    "ts-loader": "4.0.1",
    "tslint": "5.9.1",
    "tslint-config-prettier": "1.9.0",
    "tslint-loader": "3.6.0",
    "typescript": "2.7.2",
    "uglifyjs-webpack-plugin": "1.2.5",
    "webpack": "4.8.0",
    "webpack-cli": "2.1.3",
    "webpack-dev-server": "3.1.4",
    "webpack-merge": "4.1.2",
    "webpack-notifier": "1.6.0",
    "webpack-visualizer-plugin": "0.1.11",
    "workbox-webpack-plugin": "3.2.0",
    "write-file-webpack-plugin": "4.2.0",
    "xml2js": "0.4.19"
  },
  "engines": {
    "node": ">=8.9.0",
    "yarn": ">=1.3.2"
  },
  "lint-staged": {
    "src/**/*.{ts,css,scss}": [
      "prettier --write",
      "git add"
    ]
  },
  "scripts": {
    "precommit": "lint-staged",
    "prettier:format": "yarn prettier --write 'src/**/*.{ts,css,scss}'",
    "lint": "tslint --project tsconfig.json -e 'node_modules/**'",
    "lint:fix": "yarn run lint --fix",
    "ngc": "ngc -p tsconfig-aot.json",
    "cleanup": "rimraf target/{aot,www}",
    "clean-www": "rimraf target//www/app/{src,target/}",
    "start": "yarn run webpack:dev",
    "serve": "yarn run start",
    "build": "yarn run webpack:prod",
    "test": "yarn run lint && jest --coverage --logHeapUsage -w=2 --config src/test/javascript/jest.conf.js",
    "test:watch": "yarn test --watch --clearCache",
    "webpack:dev": "yarn run webpack-dev-server --config webpack/webpack.dev.js --progress --inline --hot --profile --port=9060 --watch-content-base",
    "webpack:build:main": "yarn run webpack --config webpack/webpack.dev.js --progress --profile",
    "webpack:build": "yarn run cleanup && yarn run webpack:build:main",
    "webpack:prod:main": "yarn run webpack --config webpack/webpack.prod.js --profile",
    "webpack:prod": "yarn run cleanup && yarn run webpack:prod:main && yarn run clean-www",
    "webpack:test": "yarn run test",
    "webpack-dev-server": "node --max_old_space_size=4096 node_modules/webpack-dev-server/bin/webpack-dev-server.js",
    "webpack": "node --max_old_space_size=4096 node_modules/webpack/bin/webpack.js"
  },
  "jestSonar": {
    "reportPath": "target/test-results/jest",
    "reportFile": "TESTS-results.xml"
  }
}

Spring security configuration with angular served by backend

copy iconCopydownload iconDownload
.antMatchers("/").permitAll()  //root level
.antMatchers("/api/public/**,/index.html**").permitAll()

frontend-maven-plugin when it runs npm run build can't find package.json file

copy iconCopydownload iconDownload
<plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>1.9.1</version>
                <configuration>
                    <nodeVersion>v12.16.3</nodeVersion>
                    <workingDirectory>client</workingDirectory>
                    <installDirectory>target</installDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>install-npm</id>
                        <goals>
                            <goal>install-node-and-npm</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>npm-install</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>npm run build</id>
                        <goals>
                            <goal>npm</goal>
                        </goals>
                        <configuration>
                            <arguments>run build</arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

How to package React front end with Spring Boot and run the executable jar?

copy iconCopydownload iconDownload
    .antMatchers("/home/**").permitAll()
    .antMatchers("/**").permitAll()
@Override
protected void configure(HttpSecurity http) throws Exception {
    http.cors().and().csrf().disable()
        .exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and()
        .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
        .authorizeRequests().antMatchers("/api/auth/**").permitAll()
        .antMatchers("/api/test/**").permitAll()
        .antMatchers("/home/**").permitAll()
        .antMatchers("/**").permitAll()
        .anyRequest().authenticated();

    http.addFilterBefore(authenticationJwtTokenFilter(), UsernamePasswordAuthenticationFilter.class);
}
      <Route exact path={["/", "/home"]} component={Home} />
  componentDidMount() {
    UserService.getPublicContent().then(
      response => {
        this.setState({
          content: response.data
        });
      },
const API_URL = 'http://localhost:8080/api/test/';

class UserService {
  getPublicContent() {
    return axios.get(API_URL + 'all');
  }
@RequestMapping("/api/test")
public class TestController {
    @GetMapping("/all")
    public String allAccess() {
        return "Public Content.";
    }
-----------------------
    .antMatchers("/home/**").permitAll()
    .antMatchers("/**").permitAll()
@Override
protected void configure(HttpSecurity http) throws Exception {
    http.cors().and().csrf().disable()
        .exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and()
        .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
        .authorizeRequests().antMatchers("/api/auth/**").permitAll()
        .antMatchers("/api/test/**").permitAll()
        .antMatchers("/home/**").permitAll()
        .antMatchers("/**").permitAll()
        .anyRequest().authenticated();

    http.addFilterBefore(authenticationJwtTokenFilter(), UsernamePasswordAuthenticationFilter.class);
}
      <Route exact path={["/", "/home"]} component={Home} />
  componentDidMount() {
    UserService.getPublicContent().then(
      response => {
        this.setState({
          content: response.data
        });
      },
const API_URL = 'http://localhost:8080/api/test/';

class UserService {
  getPublicContent() {
    return axios.get(API_URL + 'all');
  }
@RequestMapping("/api/test")
public class TestController {
    @GetMapping("/all")
    public String allAccess() {
        return "Public Content.";
    }
-----------------------
    .antMatchers("/home/**").permitAll()
    .antMatchers("/**").permitAll()
@Override
protected void configure(HttpSecurity http) throws Exception {
    http.cors().and().csrf().disable()
        .exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and()
        .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
        .authorizeRequests().antMatchers("/api/auth/**").permitAll()
        .antMatchers("/api/test/**").permitAll()
        .antMatchers("/home/**").permitAll()
        .antMatchers("/**").permitAll()
        .anyRequest().authenticated();

    http.addFilterBefore(authenticationJwtTokenFilter(), UsernamePasswordAuthenticationFilter.class);
}
      <Route exact path={["/", "/home"]} component={Home} />
  componentDidMount() {
    UserService.getPublicContent().then(
      response => {
        this.setState({
          content: response.data
        });
      },
const API_URL = 'http://localhost:8080/api/test/';

class UserService {
  getPublicContent() {
    return axios.get(API_URL + 'all');
  }
@RequestMapping("/api/test")
public class TestController {
    @GetMapping("/all")
    public String allAccess() {
        return "Public Content.";
    }
-----------------------
    .antMatchers("/home/**").permitAll()
    .antMatchers("/**").permitAll()
@Override
protected void configure(HttpSecurity http) throws Exception {
    http.cors().and().csrf().disable()
        .exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and()
        .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
        .authorizeRequests().antMatchers("/api/auth/**").permitAll()
        .antMatchers("/api/test/**").permitAll()
        .antMatchers("/home/**").permitAll()
        .antMatchers("/**").permitAll()
        .anyRequest().authenticated();

    http.addFilterBefore(authenticationJwtTokenFilter(), UsernamePasswordAuthenticationFilter.class);
}
      <Route exact path={["/", "/home"]} component={Home} />
  componentDidMount() {
    UserService.getPublicContent().then(
      response => {
        this.setState({
          content: response.data
        });
      },
const API_URL = 'http://localhost:8080/api/test/';

class UserService {
  getPublicContent() {
    return axios.get(API_URL + 'all');
  }
@RequestMapping("/api/test")
public class TestController {
    @GetMapping("/all")
    public String allAccess() {
        return "Public Content.";
    }
-----------------------
    .antMatchers("/home/**").permitAll()
    .antMatchers("/**").permitAll()
@Override
protected void configure(HttpSecurity http) throws Exception {
    http.cors().and().csrf().disable()
        .exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and()
        .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
        .authorizeRequests().antMatchers("/api/auth/**").permitAll()
        .antMatchers("/api/test/**").permitAll()
        .antMatchers("/home/**").permitAll()
        .antMatchers("/**").permitAll()
        .anyRequest().authenticated();

    http.addFilterBefore(authenticationJwtTokenFilter(), UsernamePasswordAuthenticationFilter.class);
}
      <Route exact path={["/", "/home"]} component={Home} />
  componentDidMount() {
    UserService.getPublicContent().then(
      response => {
        this.setState({
          content: response.data
        });
      },
const API_URL = 'http://localhost:8080/api/test/';

class UserService {
  getPublicContent() {
    return axios.get(API_URL + 'all');
  }
@RequestMapping("/api/test")
public class TestController {
    @GetMapping("/all")
    public String allAccess() {
        return "Public Content.";
    }
-----------------------
    .antMatchers("/home/**").permitAll()
    .antMatchers("/**").permitAll()
@Override
protected void configure(HttpSecurity http) throws Exception {
    http.cors().and().csrf().disable()
        .exceptionHandling().authenticationEntryPoint(unauthorizedHandler).and()
        .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
        .authorizeRequests().antMatchers("/api/auth/**").permitAll()
        .antMatchers("/api/test/**").permitAll()
        .antMatchers("/home/**").permitAll()
        .antMatchers("/**").permitAll()
        .anyRequest().authenticated();

    http.addFilterBefore(authenticationJwtTokenFilter(), UsernamePasswordAuthenticationFilter.class);
}
      <Route exact path={["/", "/home"]} component={Home} />
  componentDidMount() {
    UserService.getPublicContent().then(
      response => {
        this.setState({
          content: response.data
        });
      },
const API_URL = 'http://localhost:8080/api/test/';

class UserService {
  getPublicContent() {
    return axios.get(API_URL + 'all');
  }
@RequestMapping("/api/test")
public class TestController {
    @GetMapping("/all")
    public String allAccess() {
        return "Public Content.";
    }

Dockerfile fails on Java class not found, how to specify classpath or jar to ./mvnw?

copy iconCopydownload iconDownload
From openjdk:8
CPOY ./app .
RUN ./mvnw clean install -Pprod
WORKDIR /target
CMD ["java","-jar","licensing-app-0.0.1-SNAPSHOT.jar"]

How to build maven war file with angular 2

copy iconCopydownload iconDownload
 <plugin>
                    <groupId>com.github.eirslett</groupId>
                    <artifactId>frontend-maven-plugin</artifactId>
                    <version>1.6</version>
                    <configuration>
                        <workingDirectory>src/main/frontend</workingDirectory>
                    </configuration>
                    <executions>
                        <execution>
                            <id>npm install</id>
                            <goals>
                                <goal>npm</goal>
                            </goals>
                            <configuration>
                                <arguments>install</arguments>
                            </configuration>
                        </execution>
                        <execution>
                            <id>npm build</id>
                            <goals>
                                <goal>npm</goal>
                            </goals>
                            <configuration>
                                <arguments>run buildProduction</arguments>
                            </configuration>
                            <phase>generate-resources</phase>
                        </execution>
                    </executions>
                </plugin>

Community Discussions

Trending Discussions on frontend-maven-plugin
  • npm install fails on an uglify-js folder that is emptying during its execution
  • dockerBuild fails resulting in an unsupported class file major version 61 error
  • Java Compiler Assertion Error Spring Boot 2.4.X
  • JHipster 7.1.0 ReactJS building jar
  • Spring boot with react url not found issue
  • Build angular 11 with Spring boot 2.x in one single jar
  • Is there a way to fix Ambari Web 2.7.1.0.0 build issue?
  • Stop Eclipse/Maven from invoking one particular plugin
  • How to resolve TLS version issue with MongoDB cluster in java Spring Boot web project?
  • How to configure webpack correctly?
Trending Discussions on frontend-maven-plugin

QUESTION

npm install fails on an uglify-js folder that is emptying during its execution

Asked 2022-Feb-23 at 20:43

I'm entering a project where npm produces an issue for a long time, and none have the knowledge of when and why it appeared. I would like to have some clues on where (or what) to search.

a simple mvn clean install performs an npm install after having installed the npm plugin.

I can see that his work involves the creation (or the presence) of a link that will makes a directory
target/node/node_modules/uglify-js targeting ~/front-end/uglify-js/

this last one appearing to be a source folder (?) of our project, or something needed by npm (I don't know uglify myself). As I can see:

find  ~/front-end/target/node/node_modules -type l -ls
3096224744204072      0 lrwxrwxrwx   1 me  1049089       101 Oct 18 09:20 /c/Users/front-end/target/node/node_modules/uglify-js -> /c/Users/front-end/uglify-js/

That folder ~/front-end/uglify-js/ is initially carrying files package.json, index.js and link-package.js

But when npm install takes place, it fails on an addLocal internal step.

[INFO] --- frontend-maven-plugin:1.3:npm (npm install) @ front-end ---
[DEBUG] Configuring mojo com.github.eirslett:frontend-maven-plugin:1.3:npm from plugin realm ClassRealm[plugin>com.github.eirslett:frontend-maven-plugin:1.3, parent: sun.misc.Launcher$AppClassLoader@4e25154f]
[DEBUG] Configuring mojo 'com.github.eirslett:frontend-maven-plugin:1.3:npm' with basic configurator -->
[DEBUG]   (f) arguments = install
[DEBUG]   (f) installDirectory = C:\Users\front-end\target
[DEBUG]   (f) npmInheritsProxyConfigFromMaven = true
[DEBUG]   (f) project = MavenProject: com.front-end:front-end:10.7.14-xxx_yyyyy @ C:\Users\front-end\pom.xml
[DEBUG]   (f) repositorySystemSession = org.eclipse.aether.DefaultRepositorySystemSession@585c13de
[DEBUG]   (f) session = org.apache.maven.execution.MavenSession@187eb9a8
[DEBUG]   (f) skip = false
[DEBUG]   (f) skipTests = false
[DEBUG]   (f) workingDirectory = C:\Users\front-end
[DEBUG]   (f) execution = com.github.eirslett:frontend-maven-plugin:1.3:npm {execution: npm install}
[DEBUG] -- end configuration --
[INFO] Running 'npm install' in C:\Users\front-end
[ERROR] npm ERR! addLocal Could not install C:\Users\front-end\uglify-js
[ERROR] npm ERR! Windows_NT 10.0.18363
[ERROR] npm ERR! argv "C:\\Users\\front-end\\target\\node\\node.exe" "C:\\Users\\front-end\\target\\node\\node_modules\\npm\\bin\\npm-cli.js" "install"
[ERROR] npm ERR! node v10.24.1
[ERROR] npm ERR! npm  v2.15.12
[ERROR] npm ERR! code EISDIR
[ERROR] npm ERR! errno -4068
[ERROR] npm ERR! syscall read
[ERROR]
[ERROR] npm ERR! eisdir EISDIR: illegal operation on a directory, read
[ERROR] npm ERR! eisdir This is most likely not a problem with npm itself
[ERROR] npm ERR! eisdir and is related to npm not being able to find a package.json in
[ERROR] npm ERR! eisdir a package you are trying to install.

What I can see after this failure happens, it's that there is an existing folder ~/front-end/uglify-js/ on my disk, but that it is now empty : it has been recreated.
And the npm-debug.log gives no other information than the one upper.

If I restore the missing files (package.json, index.js, link-package.js) in that directory and retry mvn clean install this problem won't reproduce.
As if it was occurring only one time per day? Humm... Unsure...

Our node and npm version are : node v10.24.1 and npm v2.15.12.

ANSWER

Answered 2022-Feb-23 at 20:43

We eventually found that it's a Maven issue that is the cause of our trouble.

It doesn't honor it's <followSymLinks>false</followSymLinks> settings and follows it whatever, and during the removal of a link file in target directory, npm causes (by Maven) the deletion of the file source of the link.

Source https://stackoverflow.com/questions/69613756

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install frontend-maven-plugin

Include the plugin as a dependency in your Maven project. Change LATEST_VERSION to the latest tagged version.
Run $ mvn clean install.

Support

This plugin contains support for M2E, including lifecycle mappings and support for incremental builds in Eclipse. The install-node-and-npm goal will only run on a full project build. The other goals support incremental builds to avoid doing unnecessary work. During an incremental build the npm goal will only run if the package.json file has been changed. The grunt and gulp goals have new srcdir and triggerfiles optional configuration options; if these are set they check for changes in your source files before being run. See the wiki for more information.

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Share this Page

share link
Compare DevOps Libraries with Highest Security
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.