Maven: my class says HttpServletRequest not found - maven

My class complains that it couldn't find HttpServletRequest. I can google and find out what maven dependency to include in the pom file. But , is there any maven command to find out what could be the dependency to include. when we develop any maven based java application, There could be always errors like this. How to tackle them with the help of maven commands ?
Thanks,
Arun

I don't think there's such a plugin (yet). What I would do is use http://search.maven.org/#advancedsearch and fill the classname. Since this searchmethod has an API one could wrap it with a Maven plugin.

Related

Add external jar in pom.xml

I have a spring boot application with maven.
I need to use an external jar say "tp.jar". I have used the method of system scope to do the same but seems it has been deprecated. Is there any better alternative which doesn't involve running maven commands to do the same. I found some solutions here Can I add jars to maven 2 build classpath without installing them?
But the posts are pretty old was wondering if any new solution and convenient solution has been found.
If you are in a company doing Java, you probably have a Nexus or Artifactory server running. This is the place to put the jar. Then you can use all Maven mechanisms to use it.

How to upload custom jars to Maven repository

I have a custom jar named core-ui-1.0.jar which is based on Spring. I used http://download.java.net/maven/2/ repository to download spring jars to compile my java files inside core-ui-1.0.jar. Now my core-ui-1.0.jar is ready to release
Can someone help me how can I release my core-ui jar to http ://download.java.net/maven/2/ so that any person can download it from maven 2 repository the way we download spring, hibernate jars etc.
Please let me know if I have the right to upload anything to http://download.java.net/maven/2/ or am I thinking in wrong direction.
Thanks in advance.
You need to create a release. I suggest using the maven-release-plugin if you're build is based on maven.
To have your artifacts available in maven central follow the instructions here:
http://maven.apache.org/repository/index.html (and follow the links)
http://maven.apache.org/guides/mini/guide-central-repository-upload.html
I think this applies best to your project: http://central.sonatype.org/pages/ossrh-guide.html
http://central.sonatype.org/pages/requirements.html
http://central.sonatype.org/pages/choosing-your-coordinates.html

What maven dependecy do I need to support org.zkoss.reference.developer?

What maven dependency do I need to configure to support the following package :
org.zkoss.reference.developer
In maven world you may find the answer by querying the repositories, such as
[http://search.maven.org/#advancedsearch|gav]
Usually gives quite a few hits, but you need a classname

Maven ships dependencies inside war but not in jar

I have two maven projects, one (I will call it core) is an ejb-jar (ejb) and the other a war (client).
My client project consumes some ejbs inside my core...so far so good.
But I'm getting a ClassNotFoundException inside my core application because it can't find one class from apache-beanutils...I have set this dependency with compile scope in it's pom.xml but it does not get shipped inside the output jar.
When I check my client.war package I see every compile-scoped dependency inside the WEB-INF/lib folder...but in my core.jar I don't see any of it's dependencies...I'm totally confused about this.
Can someone help me? I tried to google it before asking but I didn't find anything useful so far..thanks.
You can use the maven assembly plugin to bundle all the jars in one super jar.
See this: question

Transitive dependencies within my plugin with maven 2

I'm trying to get all dependencies (include transitives) within my plugin using mavenProject.getArtifacts() but get an empty Set. part of the dependencies which I have to get cannot be resolved. I know that Maven 3 offers the #requiresDependencyCollection but that is no use for me since I must use Maven 2. What can I do?
https://svn.apache.org/repos/asf/maven/shared/trunk/maven-artifact-resolver will help with this.
For an example of its use, see https://svn.apache.org/repos/asf/cxf/trunk/maven-plugins/codegen-plugin.

Resources