如何解决maven构建错误无法执行目标com.github.eirslett?

问题描述 投票:0回答:1

我正在按照下面的例子来做 这个 链接来开发一个简单的crud应用程序。

一切都很好,直到我尝试用-Pprod参数运行它,使它作为一个单独的应用程序运行。

./mvnw spring-boot:run -Pprod 

然后就出现了这个错误

ERROR] error Command "build" not found.
[INFO] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.571 s
[INFO] Finished at: 2020-04-21T23:18:42-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:yarn (yarn build) on project licensing-app: Failed to run task: 'yarn build' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]

这里是pom.xml的相关部分。

   <id>prod</id>
    <build>
        <plugins>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-resources</id>
                        <phase>process-classes</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${basedir}/target/classes/static</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>app/build</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.github.eirslett</groupId>
                <artifactId>frontend-maven-plugin</artifactId>
                <version>${frontend-maven-plugin.version}</version>
                <configuration>
                    <workingDirectory>app</workingDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>install node</id>
                        <goals>
                            <goal>install-node-and-yarn</goal>
                        </goals>
                        <configuration>
                            <nodeVersion>${node.version}</nodeVersion>
                            <yarnVersion>${yarn.version}</yarnVersion>
                        </configuration>
                    </execution>
                    <execution>
                        <id>yarn install</id>
                        <goals>
                            <goal>yarn</goal>
                        </goals>
                        <phase>generate-resources</phase>
                    </execution>
                    <execution>
                        <id>yarn test</id>
                        <goals>
                            <goal>yarn</goal>
                        </goals>
                        <phase>test</phase>
                        <configuration>
                            <arguments>test</arguments>
                            <environmentVariables>
                                <CI>true</CI>
                            </environmentVariables>
                        </configuration>
                    </execution>
                    <execution>
                        <id>yarn build</id>
                        <goals>
                            <goal>yarn</goal>
                        </goals>
                        <phase>compile</phase>
                        <configuration>
                            <arguments>build</arguments>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
    <properties>
        <spring.profiles.active>prod</spring.profiles.active>
    </properties>
</profile>

你知道是什么原因导致的吗?

reactjs maven yarn okta
1个回答
1
投票

我刚刚尝试了克隆repo,然后运行你提到的命令:.mvnw spring-boot:..:

git clone [email protected]:oktadeveloper/okta-spring-boot-react-crud-example.git

然后运行你提到的命令

cd okta-spring-boot-react-crud-example
./mvnw spring-boot:run -Pprod

在我的机器上运行! 😊

2020-04-22 12:21:16.891  INFO 79919 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2020-04-22 12:21:16.897  INFO 79919 --- [           main] c.o.d.jugtours.JugToursApplication       : Started JugToursApplication in 5.59 seconds (JVM running for 46.727)
2020-04-22 12:21:16.978  INFO 79919 --- [           main] o.h.h.i.QueryTranslatorFactoryInitiator  : HHH000397: Using ASTQueryTranslatorFactory
Group(id=1, name=Denver JUG, address=null, city=null, stateOrProvince=null, country=null, postalCode=null, user=null, events=[Event(id=5, date=2018-12-12T18:00:00Z, title=Full Stack Reactive, description=Reactive with Spring Boot + React, attendees=[])])
Group(id=2, name=Utah JUG, address=null, city=null, stateOrProvince=null, country=null, postalCode=null, user=null, events=[])
Group(id=3, name=Seattle JUG, address=null, city=null, stateOrProvince=null, country=null, postalCode=null, user=null, events=[])
Group(id=4, name=Richmond JUG, address=null, city=null, stateOrProvince=null, country=null, postalCode=null, user=null, events=[])
© www.soinside.com 2019 - 2024. All rights reserved.