0

There is a java project built with Maven. I have project sources, need to improve something and then rebuild the project. The problem is one of Maven dependencies is now lost (seems like it was only in developer's local repo). But there is a compiled project (.ear). I suppose it has code from that Maven dependency.

Is there a way to build a project using old project's compiled files?

awfun
  • 2,316
  • 4
  • 31
  • 52
  • Can you clarify? IF you have all of the sources, and you have the pom.xml file from maven, you should usually be able to just run "mvn package" and it will recompile and package everything for you. The .ear isn't needed. – FrobberOfBits Sep 18 '14 at 13:08
  • I have sources with Maven dependency, `artifactId = avSignatureV`. In project it is used like `import SignatureV.SignatureVerifier;`. The depenency is not resolved, but I have a whole compiled project. – awfun Sep 18 '14 at 13:17
  • If the maven pom is hosed or incomplete, you probably wouldn't be able to recompile. If you already have an .ear file, why do you need to recompile? Please edit your question and add more details on what you're trying to do, it's hard to tell. – FrobberOfBits Sep 18 '14 at 13:18
  • Please post the actual missing dependency; with full group and artifact name. It might be that the dependency simply moved since the ear was last built. But it might also be that the project was depending on a local nexus with a manually maintained third party repository for example. Its impossible to know if you don't post the details. – Gimby Sep 18 '14 at 13:35

2 Answers2

1

Extract the required jar from old ear, and in new pom add that jar as dependency,

<dependency>
            <groupId>GroupId</groupId>
            <artifactId>ArtifactId</artifactId>
            <version>VersionNo</version>
            <scope>system</scope>
            <systemPath>path/to/the/jar</systemPath>
        </dependency>
Manjunath D R
  • 371
  • 2
  • 8
0

You can use the compiled jar's and put them into library folder and rebuild path.

Advicer
  • 1,300
  • 1
  • 14
  • 26