Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Conflicts with eclipse-repository types and other maven plugins

we've added clean to the initialize phase of the default lifecycle of eclipse-repository:

              <initialize>
                <!-- P2 publisher application will accumulate the published content in resulting repositories.
                The build needs to guarantee that legacy build content is removed from output folder prior to each build. -->
              	org.apache.maven.plugins:maven-clean-plugin:${clean-plugin.version}:clean
              </initialize>

as you found, this can cause problems with plugins forking the lifecycle [1] or aggregator plugins.

If we don't clean, we would keep accumulating content produced by local builds (each with different SNAPSHOT timestamps in the version) in the resulting repo.
This is unexpected/undesired in general so I think it's a good idea to clean even if the clean lifecycle is not explicitly invoked.

>From my experience forked lifecycles/aggregators can have all kinds of unexpected results so I'm unsure if this is something we should support.

@Igor any thoughts?

Jan


[1] http://www.sonatype.com/books/mvnref-book/reference/writing-plugins-sect-plugins-lifecycle.html 

-----Original Message-----
From: tycho-user-bounces@xxxxxxxxxxx [mailto:tycho-user-bounces@xxxxxxxxxxx] On Behalf Of Roland Grunberg
Sent: Montag, 10. Dezember 2012 16:55
To: Tycho user list
Subject: [tycho-user] Conflicts with eclipse-repository types and other maven plugins

I have a question about ways in which Tycho might cause unexpected
behaviour when used with other maven plugins.

Given a multi-module project with :

- a few projects of type 'eclipse-plugin'
- an 'eclipse-feature' project that includes those plugins
- an 'eclipse-repository' project with category.xml that properly includes
  the feature
- maven-javadoc-plugin defined in pluginManagement at the top-level pom

If I run 'mvn clean install javadoc:aggregate', the javadocs are generated 
in the top-level target folder but the target folder for the
'eclipse-repository' project (which should contain the published p2
repository) doesn't exist.

If I just run just 'mvn clean install' then the target folder for the 
'eclipse-repository' project contains the p2 repository.

The problem seems to be that the maven-javadoc-plugin invokes the 
generate-sources phase on every project, and for 'eclipse-repository'
types this triggers a clean in the initialize phase. This wipes out the
target folder and its contents.

On the other hand one could try running 'mvn clean javadoc:aggregate 
install' but I've had cases where doing this causes the javadoc:aggregate
goal to fail to resolve certain projects. I don't know exactly why this was
happening, but it seemed related to the fact that the javadoc:aggragate
goal expects compile-time dependencies to be resolved, and yet since the
plugin runs on separate projects in parallel, it can fail that way
(assuming the reactor cache is clean the first time).

It's simple enough to work around these issues by adding some extra goals/
copying things around but is there any plan to get these plugins more able
to coexist in the same build ?

Cheers,
-- 
Roland Grunberg
_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-user


Back to the top