We have a backend springboot application along with reactjs frontend build together. Currently, the reactjs application is building successfully with the spring boot application.
However,we need to get the configuration value from the pom.xml(OR from application.yml) to the ReactJS project.
Is there anyone who has done these type of configuration reading from the frontend?
Following is part of the pox.xml file which has plugins section
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>${frontend-maven-plugin.version}</version>
<configuration>
<workingDirectory>src/main/resources/ui-resources</workingDirectory>
<!--<nodeDownloadRoot>https://npm.taobao.org/mirrors/node/</nodeDownloadRoot>-->
<nodeVersion>${node.version}</nodeVersion>
<npmVersion>${npm.version}</npmVersion>
<yarnVersion>${yarn.version}</yarnVersion>
<installDirectory>target</installDirectory>
</configuration>
<executions>
<execution>
<id>install node and yarn</id>
<goals>
<goal>install-node-and-yarn</goal>
</goals>
<phase>generate-resources</phase>
</execution>
<execution>
<id>yarn install</id>
<goals>
<goal>yarn</goal>
</goals>
<configuration>
<arguments>install --check-cache</arguments>
</configuration>
</execution>
<execution>
<id>yarn build</id>
<goals>
<goal>yarn</goal>
</goals>
<configuration>
<arguments>build</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-ui-resources</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<!--
<outputDirectory>src/main/resources/static</outputDirectory>
-->
<outputDirectory>target/classes/static</outputDirectory>
<resources>
<resource>
<directory>${basedir}/src/main/resources/ui-resources/build</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>