frontend-maven-plugin icon indicating copy to clipboard operation
frontend-maven-plugin copied to clipboard

Method buildPath not found in jsp

Open teger opened this issue 1 year ago • 4 comments

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

teger avatar Mar 20 '24 07:03 teger

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>

eirslett avatar Mar 20 '24 22:03 eirslett

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

" />

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 avatar Mar 21 '24 09:03 teger

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/
				<execution>
					<id>npm-test</id>
					<goals>
						<goal>npm</goal>
					</goals>
					<phase>test</phase>
					<configuration>
						<arguments>test</arguments>
					</configuration>
				</execution>

				<execution>
					<id>webpack-build</id>
					<goals><goal>npm</goal></goals>
					<phase>compile</phase>
					<configuration>
						<arguments>run build-dev</arguments>
					</configuration>
				</execution>
			</executions>
		</plugin>

teger avatar Mar 21 '24 09:03 teger

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.

eirslett avatar Mar 21 '24 10:03 eirslett