Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ETHALFOS24-82: Fix including compiled classes in amp #47

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ We have to note that we are overriding the *SolrJSONResultSet.class* file with o
Before intercepting the query method, we will check if this function exists. In the build.gradle you can find the *sourceSets* directive that will copy our class to the classes directory in tomcat, effectively overriding the existing one.
You can find the overriding class here inside the running alfresco container:

***/usr/local/tomcat/webapps/alfresco/WEB-INF/classes/org/alfresco/repo/search/impl/lucene***
***/usr/local/tomcat/webapps/alfresco/WEB-INF/classes/org/alfresco/repo/search/impl/solr***

The risk exists in the fact that, when we upgrade alfresco, we no longer know if the copy we took of *SolrJSONResultSet.class* to add our *getResponseBodyAsJSONObject* function to is still correct. This can lead to very hard to troubleshoot issues like methodDoesNotExist

Expand Down
9 changes: 9 additions & 0 deletions alfresco-solr-query-analytics/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ test {
useJUnitPlatform()
}

sourceSets {
main {
amp {
// add compiled classes to amp so the original alfresco class is overwritten
config.srcDir(compileJava.destinationDirectory)
}
}
}

java {
withJavadocJar()
withSourcesJar()
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ subprojects {
description = "Alfresco solr query analytics"

group = 'eu.xenit.alfresco'
version = version = '2.0.2' + getVersionQualifier()
version = '2.0.3' + getVersionQualifier()
ext.isReleaseVersion = !(version.endsWith("SNAPSHOT"))

// It is not possible to set properties with a dot via GitHub Actions env variables, therefore we introduce support
Expand Down
Loading