Skip to content

Commit

Permalink
fix(compiler): remove duplicates from classpath
Browse files Browse the repository at this point in the history
  • Loading branch information
rbioteau committed Oct 5, 2024
1 parent b70aa6e commit f460998
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.nio.file.Files;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -94,14 +95,16 @@ public byte[] build(final BusinessObjectModel bom, final IOFileFilter fileFilter
* @throws ClassNotFoundException if a required class cannot be found in the current classloader
*/
protected Set<File> getCompileDependencies() throws ClassNotFoundException {
return Set.of(
JDTCompiler.lookupJarContaining(Entity.class),
JDTCompiler.lookupJarContaining(org.bonitasoft.engine.bdm.Entity.class),
JDTCompiler.lookupJarContaining(JsonIgnore.class),
JDTCompiler.lookupJarContaining("org.hibernate.annotations.Parameter"),
JDTCompiler.lookupJarContaining(DateConverter.class),
JDTCompiler.lookupJarContaining(SBonitaRuntimeException.class),
JDTCompiler.lookupJarContaining("org.bonitasoft.engine.business.data.BusinessDataRepository"));
var compileDependencies = new HashSet<File>();
compileDependencies.add(JDTCompiler.lookupJarContaining(Entity.class));
compileDependencies.add(JDTCompiler.lookupJarContaining(org.bonitasoft.engine.bdm.Entity.class));
compileDependencies.add(JDTCompiler.lookupJarContaining(JsonIgnore.class));
compileDependencies.add(JDTCompiler.lookupJarContaining("org.hibernate.annotations.Parameter"));
compileDependencies.add(JDTCompiler.lookupJarContaining(DateConverter.class));
compileDependencies.add(JDTCompiler.lookupJarContaining(SBonitaRuntimeException.class));
compileDependencies
.add(JDTCompiler.lookupJarContaining("org.bonitasoft.engine.business.data.BusinessDataRepository"));
return compileDependencies;
}

protected void addSourceFilesToDirectory(final BusinessObjectModel bom, final File directory)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,13 @@ public ClientBDMJarBuilder(ResourcesLoader resourcesLoader) {
protected Set<File> getCompileDependencies() throws ClassNotFoundException {
var compileDependencies = new HashSet<>(super.getCompileDependencies());
// Add dependencies to compile client jar
compileDependencies.addAll(Set.of(
JDTCompiler.lookupJarContaining("org.bonitasoft.engine.api.TenantAPIAccessor"),
JDTCompiler.lookupJarContaining(
"org.bonitasoft.engine.bdm.dao.client.resources.BusinessObjectDeserializer"),
JDTCompiler.lookupJarContaining(MethodHandler.class),
JDTCompiler.lookupJarContaining(ObjectMapper.class),
JDTCompiler.lookupJarContaining(ObjectCodec.class),
JDTCompiler.lookupJarContaining(Field.class)));
compileDependencies.add(JDTCompiler.lookupJarContaining("org.bonitasoft.engine.api.TenantAPIAccessor"));
compileDependencies.add(JDTCompiler.lookupJarContaining(
"org.bonitasoft.engine.bdm.dao.client.resources.BusinessObjectDeserializer"));
compileDependencies.add(JDTCompiler.lookupJarContaining(MethodHandler.class));
compileDependencies.add(JDTCompiler.lookupJarContaining(ObjectMapper.class));
compileDependencies.add(JDTCompiler.lookupJarContaining(ObjectCodec.class));
compileDependencies.add(JDTCompiler.lookupJarContaining(Field.class));
return compileDependencies;
}

Expand Down

0 comments on commit f460998

Please sign in to comment.