Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Can tycho build both an eclipse OSGi bundle and a test jar from one project?

>>>>> Steinar Bang <sb@xxxxxx>:

> And it kind-of-sort-of works... that is: it works when running maven
> from the command line.

> But it doesn't work in m2e, which sort of defeats the TDD purpose,
> because m2e doesn't pick up on the testSourceDirectory setting
> ("src/test/java" doesn't appear in the eclipse project).

> I guess I could create a separate test project that isn't a plugin
> project and use ordinary project dependencies for that... that would
> work for TDD but not for command line maven builds (at least I don't
> think so...?).

I ended up doing exactly this: I created a new maven module project,
called modeler.core.test in the top level maven project (as created from
tycho-eclipse-plugin-archetype) using maven-archetype-quickstart

Then I deleted the production source directory and all of its contents,
made a package that matched the package in the modeler.core project, and
was able to TDD up a class.

So now it works as I would like it to in m2e in eclipse.

Command line maven builds almost works (there is a test failure right
now, but I think that has a different reason).

The interesting bit will be to see if this affects the tycho-built
plugin that is to be the eventual result of this project.

Here's the code I'm working on:
 https://github.com/steinarb/modeler




Back to the top