मेवेन में प्रोफाइल का उपयोग करना चलाना कॉन्फ़िगरेशन के करीब है जो एक्लिप्स प्रदान करता है लेकिन काफी लचीला नहीं है। तो आप अपनी पीओएम.एक्सएमएल
<profiles>
<profile>
<id>Config1</id>
<build>
<plugins>
<plugin>
<!-- create an all-in-one executable jar with maven-shade-plugin bound
to phase:package special handling for spring.handlers/spring.schemas files
to prevent overwriting (maven-shade-plugin joins them to one file) usage:
cd to <project>/target java -jar hello-world-java-1.0-executable.jar spring/batch/job/hello-world-job.xml
helloWorldJob -->
<artifactId>maven-shade-plugin</artifactId>
<version>1.7</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<transformers>
<!-- Added this one because of runtime exception - No container
provider supports the type class org.glassfish.grizzly.http.server.HttpHandler
see - http://stackoverflow.com/questions/9787265/grizzly-and-jersey-standalone-jar -->
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.myCompany.nexgen.main.Start</mainClass>
<!-- <mainClass>org.springframework.boot.loader.Launcher</mainClass> -->
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
</transformer>
<transformer
implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>
</transformers>
<shadedArtifactAttached>true</shadedArtifactAttached>
<!-- configures the suffix name for the executable jar here it will
be '<project.artifact>-<project.version>-executable.jar' -->
<shadedClassifierName>executable</shadedClassifierName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>myLocalrun</id>
<build>
<directory>
c:\sdev\myDev\myProj
</directory>
</build>
</profile>
</profiles>
में अपनी प्रोफ़ाइल को परिभाषित कर सकते हैं फिर परियोजना गुणों में रन पर क्लिक करें। कॉन्फ़िगरेशन के लिए आपकी प्रोफ़ाइल ड्रॉपडाउन मेनू में सूचीबद्ध की जाएगी:। यहां वह जगह है जहां आप पीओएम में सूचीबद्ध प्रत्येक प्रोफ़ाइल के लिए तर्क बना सकते हैं।
यह समस्या के लिए एक पूरा जवाब नहीं है। स्पष्ट रूप से नेटबीन में आईडीई के भीतर रन कॉन्फ़िगरेशन के बीच त्वरित और आसानी से स्विच करने की क्षमता में कमी है और उन कॉन्फ़िगरेशन बिल्ड टूल से और भंडार के बाहर बाहरी हैं। मैं विभिन्न डेटाबेस से जुड़ा हूं और प्रोजेक्ट के किस पहलू पर काम कर रहा हूं, इस पर आधारित विभिन्न इनपुट कॉन्फ़िगरेशन का उपयोग करता हूं। नेटबीन में यह बहुत सीमित है। मैं नहीं चाहता कि मेरी सभी रन कॉन्फ़िगरेशन रिपोजिटरी में चेक की जाए जो परियोजना पीओएम में प्रोफाइल को जोड़ा जा रहा है।
[संपादित करें]: तो मैं ऊपर दिए गए उत्तर के साथ लगभग वहां था। अनुकूलित पर क्लिक करने से ... बटन आप अभी चुनेंगे
इस आईडीई उदाहरण
और अब इस प्रोफाइल/विन्यास पोम में संग्रहित किया जा नहीं होगा करने के लिए निजी रखें सकते हैं। वास्तव में यह परियोजना फ़ाइलों - nb-config.xml में संग्रहीत है।जब अधिकांश परियोजनाओं पर स्थानांतरित कर दिया maven या Gradle को
स्रोत
2017-02-03 17:25:23
प्रस्तावित समाधान चींटी के उपयोग मान लिया गया है। –
यहां तक कि एक प्लगइन उपलब्ध है, तर्क के साथ चलाएं, लेकिन फिर यह चींटी आधारित है। उस सुविधा की तलाश में है जो कि निर्माण उपकरण के अज्ञेयवादी है। http://plugins.netbeans.org/plugin/53855/run-with-arguments –