1

Possible Duplicate:
Maven: add a dependency to a jar by relative path

I need import a .jar file using only a buildpath in a java maven project without creating a dependency. Can this be done?

2
  • why want to import it, if not dependent? Commented Dec 26, 2012 at 16:49
  • If you don't want to use that in your packing, you can set the scope as provided in POM. Commented Dec 26, 2012 at 16:51

1 Answer 1

2

You mean that your jar is used only to compile but is not a transitive dependency?

<dependency> <groupId>foo</groupId> <artifactId>bar</artifactId> <version>1.0</version> <scope>provided</scope> </dependency> 

provided: This scope is only available on the compilation and test classpath, and is not transitive.

See more on dependency scopes

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.