Skip to content

Commit

Permalink
CHERRY-PICK: build: use maven for dependency org.apache.commons
Browse files Browse the repository at this point in the history
- allows @dependabot to keep it up-to-date
- fixes #265
  • Loading branch information
c-dilks committed Jan 28, 2025
1 parent 2d35670 commit a70614c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ updates:
directory: "/"
schedule:
interval: "weekly"
ignore:
- dependency-name: "org.apache.commons:commons-csv" # FIXME: `monitorRead.groovy` is not yet compatible with later versions of this dependency
- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand Down
3 changes: 3 additions & 0 deletions bin/run-monitoring.sh
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,9 @@ echo "RUN $runnum"
# set classpath
export JYPATH=$JYPATH
# additional env vars
export TIMELINESRC=$TIMELINESRC
# produce histograms
run-groovy \\
$TIMELINE_GROOVY_OPTS \\
Expand Down
31 changes: 31 additions & 0 deletions detectors/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,31 @@
</dependency>
</dependencies>
</plugin>
<plugin>
<!--
make sure some dependencies are installed in the local build directory, so they are
picked up in the `run-groovy` classpath; use configuration parameter `includeArtifactIds`
to copy ONLY the ones we actually need to be copied
-->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.8.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeArtifactIds>commons-csv</includeArtifactIds> <!-- need only these deps copied -->
<outputDirectory>${project.build.directory}</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand All @@ -66,6 +91,12 @@
<artifactId>groovy-dateutil</artifactId>
<version>4.0.25</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-csv -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.2</version> <!-- FIXME: `monitorRead.groovy` is not yet compatible with later versions of this dependency -->
</dependency>
<!-- https://mvnrepository.com/artifact/org.codehaus.gpars/gpars -->
<dependency>
<groupId>org.codehaus.gpars</groupId>
Expand Down
5 changes: 4 additions & 1 deletion qa-physics/monitorRead.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import org.jlab.clas.physics.LorentzVector
import org.jlab.detector.base.DetectorType
import java.lang.Math.*
import org.jlab.clas.timeline.util.Tools
@Grab('org.apache.commons:commons-csv:1.2')
import org.apache.commons.csv.CSVParser
import static org.apache.commons.csv.CSVFormat.*
import java.nio.file.Paths
Expand Down Expand Up @@ -180,6 +179,10 @@ if (FCmode==3) {

// Check if CSV file exists
def TIMELINESRC = System.getenv("TIMELINESRC")
if(TIMELINESRC == null) {
System.err.println "ERROR: \$TIMELINESRC is not set"
System.exit(100)
}
csvfilepath = Paths.get(TIMELINESRC, '/data/fccharge/'+RG+'.csv').toAbsolutePath().toString()
def csvfile = new File(csvfilepath)
if (csvfile.exists()) {
Expand Down

0 comments on commit a70614c

Please sign in to comment.