我的春天啓動的項目結構如下 -Project - src - main - java - resources - webapp - test - frontend - src - static - config - package.json - (after "npm install") node_modules - (after "npm run build") dist
要運行的exec-Maven的插件,當春天開機運行
我想要做的就是
安裝項目時,運行「故宮安裝」
當「春天啓動:運行」運行,運行「故宮運行編譯」,並在前面移動內容/ DIST到/主/ web應用
,這裏是我的pom.xml
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>exec-npm-install</id>
<phase>generate-sources</phase>
<configuration>
<executable>npm</executable>
<workingDirectory>./frontend</workingDirectory>
<arguments>
<argument>install</argument>
</arguments>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
我不知道我是如何引發的exec-NPM-安裝exection 與Eclipse Maven構建,我試圖生成來源,彈簧啓動:運行,安裝並編譯,但它沒有運行。
,我想知道我應該把什麼命令,移動DIST當「春天啓動:運行」
您需要將其移出pluginManagement區域。在pluginManagement中,你可以定義版本和參數,但是你需要把它放在pluginManagement之外。 – khmarbaise
謝謝。在Eclipse中,如果沒有插件管理,執行會發生錯誤信息,所以我把它們放在裏面。現在,作爲您的評論,我刪除了pluginManagement並忽略了執行錯誤。有用! –
你會得到什麼樣的執行錯誤? – khmarbaise