मैं एक जेनकिंस नौकरी में कई मेवेन प्रोफाइल बनाने की कोशिश कर रहा हूं। प्रत्येक प्रोफ़ाइल कुछ कोड बदलती है और फिर mvn -Pdev install
को mvn -Pprod install
को कमांड लाइन में निष्पादित करके एक जार बनाता है (mvn -Pdev,prod install
का उपयोग करके मेवेन के अनुसार काम करना चाहिए लेकिन यह मेरे लिए काम नहीं कर रहा है)।एकल जेनकिन्स नौकरी के लिए एकाधिक मेवेन प्रोफाइल बनाना
<profiles>
<!-- prod profile -->
<profile>
<id>prod</id>
<build>
<plugins>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.2</version>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<file>src/main/java/com/IQzone/android/configuration/AbstractHoldingRefreshable.java</file>
<replacements>
<replacement>
<token>TrUe</token>
<value>TOAST_SWITCH</value>
</replacement>
</replacements>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>prod</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- dev profile -->
<profile>
<id>dev</id>
<build>
<plugins>
<plugin>
<groupId>com.google.code.maven-replacer-plugin</groupId>
<artifactId>replacer</artifactId>
<version>1.5.2</version>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>replace</goal>
</goals>
</execution>
</executions>
<configuration>
<file>src/main/java/com/IQzone/android/configuration/AbstractHoldingRefreshable.java</file>
<replacements>
<replacement>
<token>TOAST_SWITCH</token>
<value>TrUe</value>
</replacement>
</replacements>
</configuration>
</plugin>
<!-- build project with JAVA 1.6 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classifier>dev</classifier>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
मैं कैसे सेटअप जेनकींस स्वचालित रूप से एक भी जेनकींस नौकरी के लिए इन प्रोफाइल के दोनों निर्माण करने के लिए चाहते हैं जब भी काम एक निर्माण के लिए मारा जाता है: यहाँ अपने प्रोजेक्ट के pom.xml
में दो प्रोफाइल कर रहे हैं? और इन दोनों जार आर्टिफैक्टरी में डाल दिया? मेरे पास जेनकिन्स ज्ञान बहुत कम है और वेब पर इस पर ज्यादा जानकारी नहीं है।
मुझे एक समस्या है जो इस तरह से कम है।मैंने इस लिंक में रखा है, क्या आप इसे देख सकते हैं और यदि आपके पास कोई समाधान है तो मुझे बताएं। https://stackoverflow.com/questions/48002535/one-profile-properties-are-overriding-with-another-profile-properties-in-maven – SubbaReddy