Great idea!

I agree that configuring the location of the little groovy script needs fixing,
to work with multiple project layouts, and also think your idea of moving this
to a spot where other build artifacts exist, is a great idea!

That way, we can refer to it via a maven artifact reference. 

If you have time, please redo this with this idea; if you don't have time, I
could probably get something done soonish...  :-)

Cheers. -Marshall

On 5/20/2020 9:58 AM, Richard Eckart de Castilho wrote:
> Ok, so let's discuss this.
>
> The idea is that instead of each project having to define the configuration 
> for the JAPICMP plugin, we pull the configuration out into the parent pom.
>
> However, the situation is that there is a post-analysis script which is 
> located in different places depending on our sub-projects, e.g.:
>
> * UIMA SDK: 
> ${project.basedir}/../uimaj-parent/src/main/groovy/api-report.groovy
> * uimaFIT : 
> ${project.basedir}/../uimafit-parent/src/main/groovy/api-report.groovy
>
> So we see here, that the script is in the module of the project-specific 
> parent POM.
>
> That is why I introduced a property `japicmp.postAnalysisScript` that could 
> be set by sub-projects in order to tell the JAPICMP configuration in the UIMA 
> parent POM where to find the script.
>
>> Another reason to avoid this change is that projects that used to 
>> intentionally
>> inherit this value will now be "broken" and need fixing when they upgrade to
>> this new version of the uima-wide pom.
> Looking at the Parent POM 13, subprojects currently inherit a fully 
> configured JAPICMP plugin
> configuration with the script-location hard-coded to the UIMA SDK location:
>
>           <plugin>              
>             <groupId>com.github.siom79.japicmp</groupId>
>             <artifactId>japicmp-maven-plugin</artifactId>
>             <version>0.9.4</version>
>             <configuration>
>               <oldVersion>
>                 <dependency>
>                   <groupId>${project.groupId}</groupId>
>                   <artifactId>${project.artifactId}</artifactId>
>                   <version>${api_check_oldVersion}</version>
>                 </dependency>
>               </oldVersion>
>               <parameter>
>                 <onlyModified>true</onlyModified>
>                 <!-- filter out classes with impl in their package or class 
> name -->
>                 
> <postAnalysisScript>${project.basedir}/../uimaj-parent/src/main/groovy/api-report.groovy</postAnalysisScript>
>                   
>               </parameter>
>             </configuration>
>             <executions>
>               <execution>
>                 <phase>verify</phase>
>                 <goals>
>                   <goal>cmp</goal>
>                 </goals>
>               </execution>
>             </executions>
>           </plugin>
>
> That currently breaks the build for all other projects using the 
> `enforce-compatibility` profile (like uimaFIT).
>
>> I thought that the common parent pom was for defaulting values, and these 
>> could
>> always be overridden by specific projects.
> Right. If a sub-project would provide its own configuration for the JAPICMP 
> plugin or set the `japicmp.postAnalysisScript` property.
>
>> If many of the projects have a common value, wouldn't it make sense to 
>> abstract
>> that to a singularly maintainable place?
>  
> Sure. I believe I hadn't thought as far at the time I worked on this change. 
> The best place might be the artifact which holds our other cross-project 
> build resources.
>
> So if we moved the post-processing script to the build resources artifact, 
> then we could probably hardcode the location in the UIMA parent POM and 
> wouldn't need that `japicmp.postAnalysisScript` property at all.
>
> WDYT?
>
> Cheers,
>
> -- Richard
>

Reply via email to