我正在尝试生成自定义的Maven原型,并且基于某些参数,我想选择一个特定的Maven配置文件。
mvn archetype:generate -DarchetypeGroupId=${archetype_groupId} -DarchetypeArtifactId=${archetype_artifactId} -DarchetypeVersion=1.0.0 -DgroupId=${groupId} -DartifactId=${artifactId} -Dversion=${version} -Dpackage=${packageName} -DgatewayName=${gatewayName} -P profile-1
在pom.xml中创建ID为(profile-1)的配置文件:
<profiles>
<profile>
<id>profile-1</id>
<activation>
<!-- <property>
<name>test.property</name>
<value>rest</value>
</property> -->
<activeByDefault>true</activeByDefault>
</activation>
<build>
<resources>
<resource>
<directory>src/main/resources/archetype-resources/src/main/resources</directory>
<excludes>
<exclude>_fileName_Handler.xml</exclude>
</excludes>
</resource>
</resources>
</build>
</profile>
执行上述mvn原型:generate时,出现异常:
The requested profile "profile-1" could not be activated because it does not exist.
任何人都可以帮忙吗?