Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tycho plugin + maven-dependency-plugin: copy dependencies from local projects instead repositories

Tags:

maven

Main Goal: deploy a project as jar and eclipse-plugin

current state: project builds fine as jar package

Now i want to create a second project which wraps the jar project as eclipse plugin

  • use tycho-maven-plugin to create eclipse-plugin
  • add the jar of the original project (with copy-dependency)
  • add an Activator
  • export packages from jar
  • create correct MANIFEST.MF

i tried to copy the jar with copy-dependencies bound to create-resources. This works as long the jar is found in repository, but the local project gets ignored. This results in a build failure since the jar is not found.

Is it possible to tell copy-dependencies to take the jar from the target directory of the project? Or should i use some other method than using tycho?

Edit:

I solved my problem with 4 projects:

  • normal project (nothing special here)
  • the wrapper project using tycho maven and copy-dependencies. bound copy dependencies to some goal before compile (e.g. generate-resources). Excluded all artefactid which were set as dependency in the MANIFEST.MF.
  • a prepare project, which calls the normal project and installs it into the repo. This is needed because the tycho-maven-plugin is bound to validate and it is not possible to call the exec plugin beforehand (at least not easy).
  • a multi module project which calls the prepare project before the wrapper project.
like image 306
Absurd-Mind Avatar asked Nov 19 '25 23:11

Absurd-Mind


1 Answers

Build your local project (which artifact was missed) with "mvm install". It will be deployed in your local repository ($USER_HOME$/.m2/repositories). After this dependency should be resolved.

Alternatively you can "mvn deploy" if you have local company maven repository like Artifactory or Nexus.

like image 161
andrey Avatar answered Nov 22 '25 04:11

andrey