I am new to programming, and I hope I do not offend anyone with my questions.
I am trying to build an ear file in TeamCity from two projects, one project builds a war file and the other builds a jar file. I was told this could be done with a POM file, is that correct?
Any help would be greatly appreciated.
I don't see how anyone could possibly be offended by this question.
Only problem is, it doesn't have anything to do with XML as far as I can see. Looks more like a question about TeamCity to me, and when I google that I find it's a continuous integration product. So let's just move it to the forum which is about "automated build tools"...
Please use code tags when posting source code - it makes posts easier to read. You can easily do this my selecting the source code in the editor box and then clicking the Code button above the editor box. I have edited your post for you this time.
The errors you are getting mean that the dependencies you are listing cannot be found in the repository. That means either:
a) You got the names wrong, and thus they cannot be found. By the way, the "name" consists of the groupId, artifactId and version - getting any of of those wrong could result in a not found error.
b) The name is right but you are not referencing the repository that contains those artifacts.
c) The artifacts are not actually in a repository, in which case either of these are possible:
c1) When you built the JAR for the EJBs and the WAR, did you build them using "mvn install"? If you do so, then Maven will load the artifacts into the local repository
c2) Use the suggested "mvn install:install-file ..." can be used to load the artifact (JAR file) into the local repository so that it can be found.
My guess is that c1 is the most likely solution to your dilemma. Of course, I strongly urge you to first read up on maven and how it works otherwise you will run into a lot of frustration and you will end up doing things incorrectly.
Joined: Apr 05, 2011
It seems the issue is, this script is looking for a POM.xml in the repository and my projects are using ivy so they is no POM file. Do you have a suggestion for the best method to take a jar file and a war file from the repository and create an ear file?
Welcome to the JavaRanch, Pat! If anyone is offended by questions, it is they who are not welcome on the Ranch, not you! Our purpose in life is to provide a place where people can ask "dumb" questions without being flamed.
If you have stuff that was built using Ivy, that means that the tool used to build them was Ant, not Maven. That's OK, but for the Maven EAR task to incorporate those artefacts, they must be placed in the Maven repository, because that's where Maven goes to resolve dependencies.
There is a process where you can take any jar-type file you want and install it into the Maven repository. Take a look at the Maven docs on installing external (third-party) jars. You will have to assign a version number(s) to the components you install, since Maven is big into co-ordinating versions of software, but you can use any version numbering scheme you like.
An IDE is no substitute for an Intelligent Developer.