2

I have the following dependency:

<dependency org="foo" name="bar" rev="1.0" conf="war-runtime->runtime" /> 

However, the jar I want this to resolve to is called foo_bar-g.jar.

At the moment it tries foo_bar.jar which fails because the jar does not exist.

Can I specify the name of my jar or a pattern in the dependency?

I have a list of resolvers specified in an ivy-settings.xml file, but this file is shared across other apps so I can't change it.

1
  • It resolves to "foo_bar.jar" and not "bar-1.0.jar" from the foo.bar-1.0 project in your Maven repository? How is this setup in your local Maven repository? Commented Nov 23, 2010 at 19:28

2 Answers 2

2

I figured this out:

In ivy_settings.xml add a custom resolver:

 <resolvers> <filesystem checkconsistency="false" checkmodified="true" name="foo.bar"> <artifact pattern="//path/to/foo_bar-g.[ext]"/> </filesystem> </resolvers> 

State that you want to use this resolver for the bar module.

 <modules> <module name="bar" organisation="foo" resolver="foo.bar"/> </modules> 

Then in ivy.xml:

<dependency org="foo" name="bar" rev="1.0"> <artifact name="bar" type="jar" ext="jar" conf="war-runtime->runtime"/> </dependency> 
Sign up to request clarification or add additional context in comments.

Comments

0

I'm not completely following your question as stated here. The dependency statement should look at at how the "runtime" configuration is defined in the foo.bar ivy.xml. That's where it states which jar file to look at in the repository.

When it gets it, then the file will be copied down depending on how your resolver is set up. The would typically be bar-1.0.jar

Where is the problem occuring? In the resolution? Or is it resolving and the local file is named differently than you want?

1 Comment

I want it to resolve to a different name. At the moment it is resolving to foo_bar.jar, but my file is called foo_bar-g.jar.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.