eirslett / frontend-maven-plugin

"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.
Apache License 2.0
4.2k stars 868 forks source link

Method buildPath not found in jsp #1139

Open teger opened 3 months ago

teger commented 3 months ago

Hi,

I execute the frontend-maven-plugin on my project. All is ok and in war, webpack compress all js and css in a separate file.

In my jsp, i have two lignes for js and css

<link rel="stylesheet" href="<%= buildPath(request,"/login.ff4f395c481812f74580.bundle.css")%>" /></head>

<script type="text/javascript" src="<%= buildPath(request,"/login.a80b653a8878d6305920.bundle.js")%>" charset="utf-8"></script>

But in these lines, i have a method buildPath But this method not found anywhere

Can you help me to import the good classe for this method ?

Thanks by advance

Best regards

eirslett commented 3 months ago

That buildPath thing is not related to the frontend-maven-plugin, it must be something specific for your application!

Just remove it. Do something like this instead:

<link rel="stylesheet" href="/login.ff4f395c481812f74580.bundle.css" />

and

<script type="text/javascript" src="/login.a80b653a8878d6305920.bundle.js" charset="utf-8"></script>
teger commented 3 months ago

Hi,

Ok but i have no lines link or script in my JSP. It's the front end maven plugin which generates these 2 lines with this method

<link rel="stylesheet" href="<%= buildPath(request,"/login.ff4f395c481812f74580.bundle.css")%>" />

<script type="text/javascript" src="<%= buildPath(request,"/login.a80b653a8878d6305920.bundle.js")%>" charset="utf-8">

Why would my application generate this buildPath method? Is this a configuration in my pom.xml to add somewhere?

Thanks for your help

Best regards

teger commented 3 months ago

It is my pom.xml

com.github.eirslett frontend-maven-plugin 1.15.0 v21.6.1 ${project.build.directory} install node and npm install-node-and-npm generate-resources npm install npm generate-resources install https://nexus.nouveauxterritoires.fr/repository/npm-group/ npm-test npm test test webpack-build npm compile run build-dev
eirslett commented 3 months ago

If you look at the source code for this plugin, and do a code search:

https://github.com/search?q=repo%3Aeirslett%2Ffrontend-maven-plugin%20buildPath&type=code

You will see that there is not a single mention of anything called buildPath in frontend-maven-plugin. Nothing.

Probably somebody else, who worked on your application, wrote the buildPath stuff.