When IntelliJ starts Spring boot, resources folder assets are not served

I'm following a tutorial similar to this one. The setup involves a pom file that manages two modules, the frontend module and the backend module.

Tools being used: IDE: Intellij, spring-boot, Vue.js

I initialized the frontent module using vue init webpack frontend. I added the pom file to the backend module which copies the assets into the backend module asset/public folder. After running mvn clean install, all content is placed in the resources/public folder. However, even though all the content is in this folder, it does not display when viewing sources in the browser.

The structure of the resources folder looks like this:

└── resources
    ├── application.properties
    └── public
        ├── index.html
        └── static
            ├── css
            │   ├── app.30790115300ab27614ce176899523b62.css
            │   └── app.30790115300ab27614ce176899523b62.css.map
            └── js
                ├── app.b22ce679862c47a75225.js
                ├── app.b22ce679862c47a75225.js.map
                ├── manifest.2ae2e69a05c33dfc65f8.js
                ├── manifest.2ae2e69a05c33dfc65f8.js.map
                ├── vendor.42fc6c515ccdfe89bd76.js
                └── vendor.42fc6c515ccdfe89bd76.js.map

I have noticed that running

java -jar backend/target/backend-0.0.1-SNAPSHOT.jar
solves the problem. However, starting the application through Intellij does not work as expected.

Full directory tree (directories only):

├── fileconverter
│   ├── backend
│   │   ├── src
│   │   └── target
│   ├── frontend
│   │   ├── build
│   │   ├── config
│   │   ├── node
│   │   ├── node_modules
│   │   ├── src
│   │   ├── static
│   │   ├── target
│   │   └── test
│   └── target
│       ├── classes
│       └── test-classes

Answer №1

So, I encountered a little hiccup where IntelliJ was utilizing the project's entire classpath instead of just the backend module.

But fear not, after simply modifying the configuration path to: Use classpath of module: backend, everything fell into place perfectly.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Securing paths in NuxtJS

Hey there! I'm just getting started with nuxt and have set up the following routes: /home /dashboard /login My goal is to secure the /dashboard route only for users who are logged in and have a token stored in LocalStorage. The simplest solution ...

E/AndroidRuntime: CRITICAL ERROR: main --- java code in an android app

I've been working on a map application and I've run into some issues. Can anyone help me figure out what's wrong with my code? ERROR 10-25 01:37:41.296 28673-28673/com.onemap.activities E/AndroidRuntime: FATAL EXCEPTION: main 10-25 01:37:4 ...

What is the best way to ensure TypeScript recognizes a variable as a specific type throughout the code?

Due to compatibility issues with Internet Explorer, I find myself needing to create a custom Error that must be validated using the constructor. customError instanceof CustomError; // false customError.constructor === CustomError; // true But how can I m ...

The battle between HTML5's async attribute and JS's async property

What sets apart the Html5 async attribute from the JS async property? <script src="http://www.google-analytics.com/ga.js" async> versus (function() { var ga = document.createElement('script'); ga.type = 'text/javascript&apo ...

How can you store previously calculated values in a costly recursive function in a React application?

Consider a scenario where there is a recursive callback function like the one shown below: const weightedFactorial = useCallback(n => { if (n === 0) { return 1; } return weight * n * weightedFactorial(n - 1); }, [weight]); Is it possible to ...

"Resolving the issue of Django request.FILE returning a null value

HTML Template: <form method="post" action="" enctype="multipart/form-data" class="form-group"> {% csrf_token %} <h1 class="m-3 text-center">New Post</h1> <div id="tui-image-e ...

Using JavaScript to toggle the iron-collapse property

I've implemented multiple <iron-collapse> elements with unique IDs, each one corresponding to a <paper-icon-button>. On screens wider than 650px, I can interact with the <iron-collapse>s using their respective buttons. But on narrow ...

"Guidelines for implementing a post-login redirection to the homepage in React with the latest version of react-router (v

I am facing an issue where I am unable to redirect to the Home Page when I click the "Login" button during my React studies. Despite trying all possible methods for redirects, none of them seem to work. The function that is executed when I click the "logi ...

Jquery countdown that persists even after refreshing the page with F5

Currently, I am in search of a jquery plugin for a countdown feature that will retain the timer even if the page is refreshed. I am developing an application for a questionnaire and I would like to display a countdown timer set to 60 minutes. In my applica ...

Understanding the Process of Accessing Array Values in Immutable.js

I'm feeling a little puzzled and struggling to figure this out. Let's say I have the following code: const AnObj = Immutable.Map({ a : "a", b : Immutable.List.of( a, b, c, Immutable.Map({ a : "a" }) ) }); When working with Immu ...

What is the reason for my algorithm's inability to work with this specific number?

I'm currently working on creating an algorithm to compute the sum of prime numbers that are less than or equal to a specified number. Below is my attempt: function calculatePrimeSum(num) { // initialize an array with numbers up to the given num let ...

Utilizing Vue.js to Dynamically Insert Template Text as HTML Element

I need a solution where I have a line like this: This line contains {{input}} as well as {{select}}. This line is fetched from the backend database and my frontend is built using Vue JS 2.6 My goal is to parse the {{input}} and convert it into an HTML in ...

Utilizing either Maps or Objects in Typescript

I'm in the process of developing a simple Pizza Ordering App. The concept is, you select a pizza from a list and it's added to a summary that groups all the selections together. Here's how I want it to appear: Pizza Margarita 2x Pizza Sala ...

`Passing JavaScript variables through HTML anchor tags`

I am currently attempting to pass the id to the controller using this method: {{ route("admin.service.edit", '+val[0]+' )}} However, the '+val[0]+' is being interpreted as a string in the URL http://localhost:8000/admin/servi ...

Displaying properties in Vue using a bound component

Offspring Vue.component('xms',{ template : `<div> {{failureMsg}} </div>`, props : { failureMsg : '', minimumLength : '', } } ) Forefather html <xms errorMsg="Is ...

I continuously encounter an issue in Vite version 3.2.4 where an error pops up stating `[vite:esbuild] The service has stopped running: write EPIPE`

When I finished creating a Vite app, I ran the command npm run dev and encountered the following error: [vite:esbuild] The service is no longer running: write EPIPE https://i.stack.imgur.com/MZuyK.png I need help solving this error. Can anyone provide gu ...

Vue: Develop a master component capable of displaying a sub-component

Is there a way to design a main component that is able to accept and display a subcomponent? Take the following scenario for instance: <Container> <Item/> <Item/> <SubMenu/> <Btn/> </Container> ...

Client.on facing issue with receiving data upon initial connection

Currently, I am utilizing the net module in order to establish a connection between my client and server. Below is the code snippet: const Net = require('net'); client = Net.connect(parseInt(port), host, function() { co ...

Incorrect configuration file for karma

To simplify the configuration of the karma config file, I have utilized variables to store specific parts of the path. var publicfolder = "public" var mypath = "packages/vendor/package/"; files: [ publicfolder+'/assets/libs/jquery/dist/jquery.js&a ...

Adjust the size and position of the text input field

I'm struggling to find a way to both resize and move the box without one action interfering with the other. Whenever I attempt to change the size of the box, it triggers the move event at the same time. Clicking on the box should make it resizable, bu ...