How can I let maven deploy to snapshot repo only classifier zip package (int) instead of 2 classifiers zip packages (dev and int)?

  Kiến thức lập trình

Using mvn clean deploy -Pint command, 2 zip files are systematically pushed to nexus snapshot repository: myapp-0.0.1-timestamp-2-dev.zip and myapp-0.0.1-timestamp-2-int.zip.
However, I aim to push only package with -int when I choose -Pint profile, and package with -dev when I choose -Pdev profile.Bellow how assembly plugin is configured with profiles:

<profile>
    <id>dev</id>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>Create dev resources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <finalName>myapp-${project.version}</finalName>
                            <descriptors>
                                <descriptor>src/main/assembly/profile_dev.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</profile>
<profile>
    <id>int</id>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <executions>
                    <execution>
                        <id>Create int resources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                        <configuration>
                            <finalName>myapp-${project.version}</finalName>
                            <descriptors>
                                <descriptor>src/main/assembly/profile_int.xml</descriptor>
                            </descriptors>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</profile>

Please let me know if you’d like that I share profile_dev.xml and profile_int.xml descriptors.
I’m using maven 3.6.3 version.
Thank you in advance for your help.

LEAVE A COMMENT