maven archiva custom archetype archetype-catalog.xml - maven-2

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?

Related

IntelliJ Jetty plugin does not extract war

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:

Why is Eclipse Maven Archetype plugin not showing my locally installed Maven archetype?

I installed the Maven archetype java8-junit5-archetype locally, but when I try to create a new Maven project in Eclipse, the Maven Archetype plugin doesn't list it.
I manually added the entry to the local catalog file ~/.m2/archetype-catalog.xml as such:
<archetype>
<groupId>com.tbp</groupId>
<artifactId>java8-junit5-archetype</artifactId>
<version>1.0-SNAPSHOT</version>
<repository></repository>
</archetype>
But In Eclipse, I don't see java8-junit5-archetype listed.
Root Cause
It turns out the reason why the java8-junit5-archetype wasn't listed, is because its version is 1.0-SNAPSHOT. That makes it a snapshot archetype.
Solution
Check the Include snapshot archetypes checkbox. Now the archetype is listed.

maven archetype plugin - No archetype found in remote catalog. Defaulting to internal catalog

$ mvn -version
Apache Maven 3.5.2 (138edd61fd100ec658bfa2d307c43b76940a5d7d; 2017-10-18T09:58:13+02:00)
Fetching dependencies from the central repository works very well.
I have a problem with fetching archetypes though.
For example I am trying to use an archetype which is present in the central archetype catalog:
mvn archetype:generate -DgroupId=com.example -DartifactId=sample-ear -DarchetypeArtifactId=wildfly-javaee7-webapp-ear-archetype -DarchetypeGroupId=org.wildfly.archetype -DinteractiveMode=false
Maven fails. It basically cannot see any archetypes in the remote catalog:
[WARNING] No archetype found in remote catalog. Defaulting to internal catalog
[WARNING] Specified archetype not found.
I am able to access the HTTP link for the catalog in a browser.
Documentation (http://maven.apache.org/archetype/maven-archetype-plugin/specification/archetype-catalog.html) states clearly:
The Archetype Plugin knows by default about its internal catalog. It also knows about the local and remote catalogs.
remote represents the http://repo.maven.apache.org/maven2/archetype-catalog.xml catalog file.
Have you ever had such issue ?
I would be grateful for any hint that could direct me to find a solution.
Add option -DarchetypeVersion=8.2.0.Final

Intellij IDEA: Server Configuration cannot be run cause file does not yet exist. Use maven goal result as artifact?

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!

how to manage dependency of shared libraries using IVY

I have a EAR -
This EAR contains multiple WAR
Inside these WAR files there is a common JAR which is getting downloaded within each WAR file.
I want to remove this common JAR file into a shared Library. Also i want the latest version of JAR file everytime i rebuild my WAR, I am using Tomcat in Dev and Websphere min production.
We are using IVY for dependency management, Now. I have removed the common jar from the war file, but i dont know how to access the latest version of jar and download it in the shared library everytime i restart my server.
Can anyone help on this.?
http://ant.apache.org/ivy/history/latest-milestone/ivyfile/dependency.html
You'll need to add a dependency to your ivy.xml file, something along the lines of:
<dependency org="com.orgname" name="jarname" rev="latest.release"/>
Is this a JAR file you make yourself, or is it publicly available? If you make it yourself, you will have to publish it in a repository somewhere in your system.