0

I'm trying to manipulate an open source project, where I have made my changes and created the WAR file. The WAR file that I have created is an "dependency" for an another module.

The code for that "dependent" module uses org.eclipse.aether.artifact.DefaultArtifact like this:

public static DefaultArtifact getReportArtifact(String version) {
        return new DefaultArtifact(ALLURE_GROUP_ID, ALLURE_REPORT_FACE_ARTIFACT_ID,"WAR", version);
    }

to get the WAR and builds it jar.

I need to pass the my local WAR file, instead of it getting from the Maven repo. How can I do that?

Thanks in advance.

batman
  • 4,728
  • 8
  • 39
  • 45
  • check this link:http://stackoverflow.com/questions/7281913/import-war-to-another-project-in-netbeans – pd30 Sep 27 '14 at 03:32
  • no your wrong. Its not what I'm looking – batman Sep 27 '14 at 04:11
  • check this link:http://stackoverflow.com/questions/1693322/eclipse-web-project-dependencies – pd30 Sep 27 '14 at 04:27
  • @pd30: please understand and post. Your wrong. Thanks. – batman Sep 27 '14 at 04:29
  • Cant you create a jar of your updated project and add it directly in your dependent proj rather than passing it a WAR? If yes, then let me know I can help you add your JAR without fetching it from the repo. – mani_nz Sep 27 '14 at 20:52
  • You are stating which kind of solution you want without stating why it is needed. There are many different ways to get a dependency files locally: local repositories, dependency plugins, system dependencies etc. but without a reason for you needing a file it would be hard to find out how to help. Other maven plugins hate system dependencies, in example – Lorenzo Boccaccia Sep 28 '14 at 14:43

2 Answers2

0

If I understand you correctly:

Maven: The Complete Reference, 3.4.1. Dependency Scope

system

[...] you have to provide an explicit path to the JAR on the local file system. [...] The artifact is assumed to always be available and is not looked up in a repository.

Gerold Broser
  • 14,080
  • 5
  • 48
  • 107
0

There are multiple approaches you can take. The most portable would be to specify an additional Maven repo in your project at a path inside (or relative to) ${project.basedir}. In there, you could install the artifacts you need, in the normal Maven fashion. This way, the build would be portable across environments without modifications.

But, I must say, I only half-understood the question as you never really explain what you're trying to achieve.

kaqqao
  • 12,984
  • 10
  • 64
  • 118