How should I configure setting.xml in a Jenkins job to use the customized repository to download a jar while building, instead of the default repository?
Related
I'm using IJ Ultimate 2020.3 and trying to set up a Jetty Server run configuration.
AFAIK, in order to start Jetty with a war artifact it is needed to be located in $JETTY_HOME/webapps directory.
But, it looks like the Jetty plugin of my IJ refuses to copy the war (exploded, or any other) artifact to that directory, which lead the Jetty server to fail.
I was able to start the Jetty server (from IJ) only after manually copying the war file into the webapps directory, so looks like the only problem is the 'copy' step.
Any ideas?
IntelliJ IDEA doesn't copy the artifact into webapps, instead it instructs Jetty to load the artifact directly from the location that you have configured as the artifact output directory.
Artifact used for deployment:
Artifact output directory:
Startup logs showing that artifact is loaded directory from its output directory and not from webapps:
Thanks #CrazyCoder, this is a progress for me.
problem is that my output console suggests that it does not search for the artifact in the location it is set:
I'm trying to create my custom archetype.
I created and deployed the archetype to the internal repository.
I'm unable to locate it when creating a new maven archetype in eclipse.
There doesn't seem to be an archetype-catalog.xml file present on the internal repository.
We are working with Apache Archiva 1.3.3 for our repository
I'm guessing that the missing archetype-catalog.xml file is the reason why we can't find the archetype in our repository.
Is there a setting that can be activated to automaticaly generate and/or update the archetype-catalog.xml file on the archiva installation?
until now I deployed to a Glassfish server with the default IntelliJ artifact "Web Application: Archive". Now my built process got a bit more complicated with maven modifying several files.
In the glassfish configuration under Deployment, I substituted the Artifact to deploy with the direct war file and put the maven goal in "Before Launch: Another Configuration"
However, if mvn clean was run the war does not exist and I cannot run the configuration (because the external file doesn't exist).
Can I avoid having to run mvn package once manually? E.g. by making the output of a maven goal an Artifact?
Thanks!
Can we dynamically load dependencies using maven.
For example, lets say we have a web project which needs a specific jar A to run on Glassfish server, while the same project needs additional jar B to run on weblogic in its WEB-INF/lib folder.
Do I need to have the separate pom.xml file for glassfish and weblogic and then run the appropriate pom.xml depending on the server being used?
Or Can I have a single pom.xml with both dependencies i.e. both jar A and jar B specified in it and depending on the parameters passed to pom.xml while running it (like mvn clean package -Dserver=glassfish), it will load the jar A only?
Is this possible?
What is the most appropriate way of doing this?
Please help.
You can exploit the concept of profiles in maven. You can create a whole profile of your execution environment and launch maven with that profile. For more info, see http://maven.apache.org/guides/introduction/introduction-to-profiles.html
These profiles can be defined within pom or can be defined in an external file and refer it to in pom. You can activate a profile by launching it with -P option, mvn -P
I have another project which contains static content (css, images, JS, etc.), and I need that to be copied to the web root directory of jetty for testing. In that project, I output a zip file packaging up all of the images, CSS, etc.
I have several of those virtualhost projects for different clients and my question is, how do I unpack the zip file that was already installed into the maven repository to the jetty web root?
#Update:
Embedded error: Unable to download the artifact from any repository
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId= com.virtualhost -DartifactId=something
-Dversion=0.0.1 -Dpackaging=zip -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=c com.virtualhost -DartifactId=something-D
version=0.0.1 -Dpackaging=zip -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[i
d]
com.virtualhost:something:zip:0.0.1
Walter
It should be possible with dependency:unpack than you could bind on prepare-package phase. See Unpacking specific artifacts for an example (in you case, use a <type>zip</type>).