replace packages in java library with storm - java

I'm new to storm and java
i imported java project using old version of storm as library but i want to use another version of storm so i should delete any packages of old storm for this project ! right ?
where can i find it?
i guess it's on the /user/.m2/repository/storm/.... i should delete storm folder on repository ? ! only or is there another thing i should do it ?
what are packages of new version of storm i should put it instead of packages of old version ?

If it is a maven project, you will have pom.xml in your project root folder.
In pom.xml, you will find all the dependencies in <dependencies>...</dependencies>
section where you will find the dependency for apache-storm as well with a version.
For the new version, you can look up in mvn repository and simply change the <version> in your dependency.
If you select any result, you will get the list of all available versions.
The path your are referring to is the maven local repository and you do not need to manually delete any of the folders. Just changing the dependency version in your pom.xml is sufficient.

Related

Maven- how to find the group id responsible for the jar file my current project is using?

Im having issues in finding the group id of the jar file my maven project is using. basically i want to add new version of that group id,artifact id in pom.xml so that new version of jar gets downloaded from nexus.
i already referred this
my jar currently looks like
/Users/harish/.m2/spring/com/local/api/platform/hike/AccountsSpecification/xxxx-creditaccounts-specification/1.5/xxxx-creditaccounts-specification-1.5.jar
and i dont see any of my pom.xml file with xxxx-creditaccounts-specification as artifact id.
kindly help me figure out which group id and artifact id is responsible for my jar file.
It's possible that this dependency is transitive. You can use Maven Dependency Plugin in order to find the origin. For example you could run in the root directory and inspect the output:
mvn dependency:tree
It could be helpful to find the dependency but update of this dependency wouldn't be straightforward if it's transitive.

How to know m2 repository generated maven version

Recently I have upgraded maven from 2.x to 3.x and then deleted the total .m2 repository from Users and again generated .m2,
Everything looks good but I want get the confirmation from repository should these all are generated using maven 3.x.
Can some one help me out?
In order to make sure that the dependencies are downloaded through your new maven version. You can add a dependency, which does not exist in your local repository, through your new project, which uses maven 3 and you run the mvn clean install command in the path, in where you parent pom is and then, you can check whether this new dependency in your local repository or not. However, as SiKing said, the content is independent from the version of the maven. You can make a small test like i described.

Maven repository's issue in Intellij IDEA

I tried all the suggested solutions which found on Stackoverflow but didn't solve the issue with Maven repositories in Intellij IDEA. The problem is that I can't find needed jars in local repository, even if I update it. Central repository is impossible to be updated. Just for example: I use in web-app servlet api (jar is found in local repo but the version is 2.5), jstl and jdbc. If I don't create Maven project I just add all the external libraries to the project manually. But in the case of Maven-project I do not add nothing but try to create dependency through Alt + Ins when writing the class. Result - there are not needed jars in local repository.
What I tried:
1.Installed/deleted a couple of versions of Maven (The current is 3.2.2)
2.Defined local repository in settings.xml (the tag missed by default)
3.Updated local repository
4.Added dependency manually in pom.xml but IDEA didn't define it
Moreover, when I created a first Maven-project in IDEA according to web-app archetype it didn't have needed folders structure but started donloading the number of jars. Current version of IDEA is 13.0. If somebody faced such problem please help me to eliminate it.
But in the case of Maven-project I do not add nothing but try to
create dependency through Alt + Ins when writing the class. Result -
there are not needed jars in local repository
You actually have to perform an maven install, this downloads the jars from whereever to your local repository. Just writing the depenecy in pom, doesn't actually download them.
This is how maven works, nothing to do with intellij.

Getting Jakarta Feedparser up in a remote Maven repository?

I short I want to get the Jakarta Feedparser project up in a remote Maven repository (the project is currently dormant).
The source is over here: http://svn.apache.org/viewvc/commons/dormant/feedparser/trunk/ (it's a Maven project)
I have been looking at Sonatype and I'm might be missing something here, but is it as simple as logging a support ticket and pointing them to the SVN source repository (https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide)?
If so I'm not 100% sure what the groupId should be, as the pom.xml gives the generic "org.apache.commons" as its groupId?
P.S. I did try and contact the project owner but with little success
The sources seem to be left in a migration state. There is a pom.xml but there is no src/main/java folder. There is also a build.xml which indicates its more of an ant build. the parent contains no modules so it looks unfinished.
Did you check out the sources and try to build it? If it does not compile it cant be added to a repository.
If it can be fixed you may add it to github creating a repository: http://blog.rueedlinger.ch/2012/09/use-github-as-maven-remote-repository/
the groupid would be org.apache.commons, the artifactId commons-feedparser. Most other libs from commons follow this convention.

Java to Maven project conversion related details

I am having a java project with a ant build file, using this ant file i create an ejb of the project and deploy it on the jboss server.
Now I am planning to use maven and convert this existing project which consist of nearly 28-30 jar's in its class path(jars related to ejb3, hibernate, jboss, etc).
I can easily do it using eclipse i.e right click project goto maven and click Conver to Maven.
A pom.xml is generated and the MavenClassPath Container is also added to the project.
Now I want to know how to get rid of those 28-30 jar's present in the lib folder of the project and in the classpath. i.e. I want my pom.xml handle all the dependencies.
Does Maven provide any mechanism to achieve this goal while converting the project or I have to add all of these jar dependencies one by one manually in the pom.xml file.
The intention of doing this is I want to have common maven remote repository where the jars will be stored and each developer machine will point to it through their maven project.
Thanks
I think you're after a repository manager like Nexus (I use Nexus, it seems to be the most popular http://nexus.sonatype.org/ ).
Nexus can be used as:
A proxy repository (for Maven Central, etc)
A repository for your own releases.
Nexus provides user management for your developers to release builds into the repo.
Developers will then point their Maven settings.xml file to your Nexus repository, and all their dependencies will come from here (Nexus will cache them).
I'm afraid you will have to configure the dependencies individually, but that is a good thing, because you should pay attention to what version ranges you are interested in for each dependency.
Any jars which can't be found in Maven Central, etc, you can add to your own Nexus repository .
Ofcourse there are alternatives to Nexus, but I haven't used any.
HTH
The most important thing i can recommend is to use a Maven Repository Manager (Nexus, Artifactory or Achiva or other..).
Second your pom conversion via Eclipse shows me that you are not using an up-to-date Eclipse nor an up-to-date Maven Plugin for Eclipse. The best thing would be use Eclipse-Indigo (m2e is the newest and greatest).
Furthermore you have to go through all your jar's and add them step by step to you pom (dependencies) and see if your project can be compiled. This should be checked on command line not inside Eclipse.
After you got a working pom.xml file put it into your version control and check if you can remove some of your added dependencies based on transitive dependencies. After that you can finally delete your lib folder.

Categories