MAVEN имеют различное исполнение для плагина в дочерних модулях - PullRequest
0 голосов
/ 08 февраля 2019

У меня есть родительский pom и childA и childB.Структура выглядит следующим образом.

`parent.xml
    -> childA.xml
       -> childA1.xml 
    -> childB.xml`

Итак, я определил плагин в профиле, который будет выполняться в childA и childB.Но мне нужно использовать тот же плагин в childA1 и запустить другое выполнение.Является ли это возможным?

ОК, у меня есть этот профиль в родительском пом

<profile>
        <id>sassConversion</id>
            <build>
        <pluginManagement>
                <plugins>
                     <plugin>
                        <groupId>com.github.eirslett</groupId>
                        <artifactId>frontend-maven-plugin</artifactId>
                        <version>1.6</version>
                        <inherited>false</inherited>
                        <configuration>
                            <nodeVersion>v10.4.1</nodeVersion>
                        </configuration>
                        <executions>
                            <execution>
                                <id>install node and npm sass</id>
                                <goals>
                                    <goal>install-node-and-npm</goal>
                                </goals>
                                <phase>generate-resources</phase>
                            </execution>
                            <execution>
                                <id>npm install sass</id>
                                <goals>
                                    <goal>npm</goal>
                                </goals>
                                <phase>generate-resources</phase>
                                <configuration>
                                    <arguments>install</arguments>
                                </configuration>
                            </execution>
                            <execution>
                                <id>npm install gulp sass</id>
                                <goals>
                                    <goal>npm</goal>
                                </goals>
                                <phase>generate-resources</phase>
                                <configuration>
                                    <arguments>install gulp-sass</arguments>
                                </configuration>
                            </execution>
                            <execution>
                                <id>gulp run sass</id>
                                <goals>
                                    <goal>gulp</goal>
                                </goals>
                                <phase>generate-resources</phase>
                                <configuration>
                                    <arguments>sass</arguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
 </pluginManagement>
            </build>
        </profile>

, который я использую в childA и childB, как

<profile>
        <id>sassConversion</id>
            <build>
                <plugins>
                     <plugin>
                        <groupId>com.github.eirslett</groupId>
                        <artifactId>frontend-maven-plugin</artifactId>
                       </plugin>
                </plugins>
            </build>
</profile>

Но в childA1 я использую тот же плагин, но это переопределяется из профиля.

<plugins>
                    <plugin>
                        <groupId>com.github.eirslett</groupId>
                        <artifactId>frontend-maven-plugin</artifactId>
                        <version>1.6</version>
                        <configuration>
                            <nodeVersion>v10.4.1</nodeVersion>
                        </configuration>
                        <executions>
                            <execution>
                                <id>install node and npm</id>
                                <goals>
                                    <goal>install-node-and-npm</goal>
                                </goals>
                                <phase>generate-resources</phase>
                            </execution>
                            <execution>
                                <id>npm install</id>
                                <goals>
                                    <goal>npm</goal>
                                </goals>
                                <phase>generate-resources</phase>
                                <configuration>
                                    <arguments>install</arguments>
                                </configuration>
                            </execution>
                            <execution>
                                <id>npm run build custom elements</id>
                                <goals>
                                    <goal>npm</goal>
                                </goals>
                                <phase>generate-resources</phase>
                                <configuration>
                                    <arguments>run build:elements</arguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>  

Выполнение из родительского pom выполняется в childA1.Определенное выполнение в childA1 не выполняется.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...