- Working with complex and multi-module Maven projects can be challenging.
- To list all modules in a project, run the command `mvn help:all-profiles`.
- The output will show the project's reactor build order and list all profiles for each module.
- The command can be helpful for navigating and understanding the structure of a multi-module project.
- The post lists various Profile Ids for different projects in Apache Beam.
Working with complex and multi-module Maven projects can be a handful.
These are a few tips to make that easier. I’m going to use Apache Beam as an example of a multi-module Maven project.
The first helpful command is to list all of the modules. To do this run mvn help:all-profiles and that will output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 | [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Reactor Build Order: [INFO] [INFO] Apache Beam :: Parent [INFO] Apache Beam :: SDKs :: Java :: Build Tools [INFO] Apache Beam :: SDKs [INFO] Apache Beam :: SDKs :: Java [INFO] Apache Beam :: SDKs :: Java :: Core [INFO] Apache Beam :: Runners [INFO] Apache Beam :: Runners :: Core Java [INFO] Apache Beam :: Runners :: Direct Java [INFO] Apache Beam :: Runners :: Google Cloud Dataflow [INFO] Apache Beam :: SDKs :: Java :: IO [INFO] Apache Beam :: SDKs :: Java :: IO :: Google Cloud Platform [INFO] Apache Beam :: SDKs :: Java :: IO :: HDFS [INFO] Apache Beam :: SDKs :: Java :: IO :: JMS [INFO] Apache Beam :: SDKs :: Java :: IO :: Kafka [INFO] Apache Beam :: SDKs :: Java :: IO :: Kinesis [INFO] Apache Beam :: SDKs :: Java :: IO :: MongoDB [INFO] Apache Beam :: SDKs :: Java :: IO :: JDBC [INFO] Apache Beam :: SDKs :: Java :: IO :: MQTT [INFO] Apache Beam :: SDKs :: Java :: Maven Archetypes [INFO] Apache Beam :: SDKs :: Java :: Maven Archetypes :: Starter [INFO] Apache Beam :: SDKs :: Java :: Maven Archetypes :: Examples [INFO] Apache Beam :: SDKs :: Java :: Maven Archetypes :: Examples - Java 8 [INFO] Apache Beam :: SDKs :: Java :: Extensions [INFO] Apache Beam :: SDKs :: Java :: Extensions :: Join library [INFO] Apache Beam :: SDKs :: Java :: Extensions :: Sorter [INFO] Apache Beam :: SDKs :: Java :: Java 8 Tests [INFO] Apache Beam :: Runners :: Flink [INFO] Apache Beam :: Runners :: Flink :: Core [INFO] Apache Beam :: Runners :: Flink :: Examples [INFO] Apache Beam :: Runners :: Spark [INFO] Apache Beam :: Runners :: Apex [INFO] Apache Beam :: Examples [INFO] Apache Beam :: Examples :: Java [INFO] Apache Beam :: Examples :: Java 8 [INFO] Listing Profiles for Project: org.apache.beam:beam-parent:pom:0.5.0-SNAPSHOT Profile Id: doclint-java8-disable (Active: true , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-sdks-java-build-tools:jar:0.5.0-SNAPSHOT Profile Id: release (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-sdks-parent:pom:0.5.0-SNAPSHOT Profile Id: release (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-sdks-java-parent:pom:0.5.0-SNAPSHOT Profile Id: java8-tests (Active: true , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-sdks-java-core:jar:0.5.0-SNAPSHOT Profile Id: java8-tests (Active: false , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-runners-parent:pom:0.5.0-SNAPSHOT Profile Id: release (Active: false , Source: pom) Profile Id: runnable-on-service-tests (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-runners-core-java:jar:0.5.0-SNAPSHOT Profile Id: release (Active: false , Source: pom) Profile Id: runnable-on-service-tests (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-runners-direct-java:jar:0.5.0-SNAPSHOT Profile Id: release (Active: false , Source: pom) Profile Id: runnable-on-service-tests (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-runners-google-cloud-dataflow-java:jar:0.5.0-SNAPSHOT Profile Id: release (Active: false , Source: pom) Profile Id: runnable-on-service-tests (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-sdks-java-io-parent:pom:0.5.0-SNAPSHOT Profile Id: java8-tests (Active: false , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-sdks-java-io-google-cloud-platform:jar:0.5.0-SNAPSHOT Profile Id: java8-tests (Active: false , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-sdks-java-io-hdfs:jar:0.5.0-SNAPSHOT Profile Id: java8-tests (Active: false , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-sdks-java-io-jms:jar:0.5.0-SNAPSHOT Profile Id: java8-tests (Active: false , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-sdks-java-io-kafka:jar:0.5.0-SNAPSHOT Profile Id: java8-tests (Active: false , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-sdks-java-io-kinesis:jar:0.5.0-SNAPSHOT Profile Id: java8-tests (Active: false , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-sdks-java-io-mongodb:jar:0.5.0-SNAPSHOT Profile Id: java8-tests (Active: false , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-sdks-java-io-jdbc:jar:0.5.0-SNAPSHOT Profile Id: java8-tests (Active: false , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-sdks-java-io-mqtt:jar:0.5.0-SNAPSHOT Profile Id: java8-tests (Active: false , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-sdks-java-maven-archetypes-parent:pom:0.5.0-SNAPSHOT Profile Id: beam-sdks-java-archetypes-examples (Active: true , Source: pom) Profile Id: beam-sdks-java-archetypes-examples-java8 (Active: true , Source: pom) Profile Id: java8-tests (Active: false , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-sdks-java-maven-archetypes-starter:maven-archetype:0.5.0-SNAPSHOT Profile Id: beam-sdks-java-archetypes-examples (Active: false , Source: pom) Profile Id: beam-sdks-java-archetypes-examples-java8 (Active: false , Source: pom) Profile Id: java8-tests (Active: false , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-sdks-java-maven-archetypes-examples:maven-archetype:0.5.0-SNAPSHOT Profile Id: beam-sdks-java-archetypes-examples (Active: false , Source: pom) Profile Id: beam-sdks-java-archetypes-examples-java8 (Active: false , Source: pom) Profile Id: java8-tests (Active: false , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-sdks-java-maven-archetypes-examples-java8:maven-archetype:0.5.0-SNAPSHOT Profile Id: beam-sdks-java-archetypes-examples (Active: false , Source: pom) Profile Id: beam-sdks-java-archetypes-examples-java8 (Active: false , Source: pom) Profile Id: java8-tests (Active: false , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-sdks-java-extensions-parent:pom:0.5.0-SNAPSHOT Profile Id: java8-tests (Active: false , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-sdks-java-extensions-join-library:jar:0.5.0-SNAPSHOT Profile Id: java8-tests (Active: false , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-sdks-java-extensions-sorter:jar:0.5.0-SNAPSHOT Profile Id: java8-tests (Active: false , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-sdks-java-java8tests:jar:0.5.0-SNAPSHOT Profile Id: java8-tests (Active: false , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-runners-flink-parent:pom:0.5.0-SNAPSHOT Profile Id: release (Active: false , Source: pom) Profile Id: runnable-on-service-tests (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-runners-flink_2.10:jar:0.5.0-SNAPSHOT Profile Id: local-runnable-on-service-tests (Active: false , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: runnable-on-service-tests (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-runners-flink_2.10-examples:jar:0.5.0-SNAPSHOT Profile Id: disable-runnable-on-service-tests (Active: true , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: runnable-on-service-tests (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-runners-spark:jar:0.5.0-SNAPSHOT Profile Id: jacoco (Active: false , Source: pom) Profile Id: local-runnable-on-service-tests (Active: false , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: runnable-on-service-tests (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-runners-apex:jar:0.5.0-SNAPSHOT Profile Id: local-runnable-on-service-tests (Active: false , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: runnable-on-service-tests (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-examples-parent:pom:0.5.0-SNAPSHOT Profile Id: java8 (Active: true , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-examples-java:jar:0.5.0-SNAPSHOT Profile Id: direct-runner (Active: true , Source: pom) Profile Id: apex-runner (Active: false , Source: pom) Profile Id: flink-runner (Active: false , Source: pom) Profile Id: spark-runner (Active: false , Source: pom) Profile Id: dataflow-runner (Active: false , Source: pom) Profile Id: jenkins-precommit (Active: false , Source: pom) Profile Id: disable-streaming-ITs (Active: false , Source: pom) Profile Id: java8 (Active: false , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) Listing Profiles for Project: org.apache.beam:beam-examples-java8:jar:0.5.0-SNAPSHOT Profile Id: include-runners (Active: true , Source: pom) Profile Id: java8 (Active: false , Source: pom) Profile Id: release (Active: false , Source: pom) Profile Id: doclint-java8-disable (Active: false , Source: pom) Profile Id: java7-packageinfo (Active: false , Source: pom) Profile Id: eclipse-jdt (Active: false , Source: pom) Profile Id: apache-release (Active: false , Source: pom) [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] [INFO] Apache Beam :: Parent .............................. SUCCESS [ 0.234 s] [INFO] Apache Beam :: SDKs :: Java :: Build Tools ......... SKIPPED [INFO] Apache Beam :: SDKs ................................ SKIPPED [INFO] Apache Beam :: SDKs :: Java ........................ SKIPPED [INFO] Apache Beam :: SDKs :: Java :: Core ................ SKIPPED [INFO] Apache Beam :: Runners ............................. SKIPPED [INFO] Apache Beam :: Runners :: Core Java ................ SKIPPED [INFO] Apache Beam :: Runners :: Direct Java .............. SKIPPED [INFO] Apache Beam :: Runners :: Google Cloud Dataflow .... SKIPPED [INFO] Apache Beam :: SDKs :: Java :: IO .................. SKIPPED [INFO] Apache Beam :: SDKs :: Java :: IO :: Google Cloud Platform SKIPPED [INFO] Apache Beam :: SDKs :: Java :: IO :: HDFS .......... SKIPPED [INFO] Apache Beam :: SDKs :: Java :: IO :: JMS ........... SKIPPED [INFO] Apache Beam :: SDKs :: Java :: IO :: Kafka ......... SKIPPED [INFO] Apache Beam :: SDKs :: Java :: IO :: Kinesis ....... SKIPPED [INFO] Apache Beam :: SDKs :: Java :: IO :: MongoDB ....... SKIPPED [INFO] Apache Beam :: SDKs :: Java :: IO :: JDBC .......... SKIPPED [INFO] Apache Beam :: SDKs :: Java :: IO :: MQTT .......... SKIPPED [INFO] Apache Beam :: SDKs :: Java :: Maven Archetypes .... SKIPPED [INFO] Apache Beam :: SDKs :: Java :: Maven Archetypes :: Starter SKIPPED [INFO] Apache Beam :: SDKs :: Java :: Maven Archetypes :: Examples SKIPPED [INFO] Apache Beam :: SDKs :: Java :: Maven Archetypes :: Examples - Java 8 SKIPPED [INFO] Apache Beam :: SDKs :: Java :: Extensions .......... SKIPPED [INFO] Apache Beam :: SDKs :: Java :: Extensions :: Join library SKIPPED [INFO] Apache Beam :: SDKs :: Java :: Extensions :: Sorter SKIPPED [INFO] Apache Beam :: SDKs :: Java :: Java 8 Tests ........ SKIPPED [INFO] Apache Beam :: Runners :: Flink .................... SKIPPED [INFO] Apache Beam :: Runners :: Flink :: Core ............ SKIPPED [INFO] Apache Beam :: Runners :: Flink :: Examples ........ SKIPPED [INFO] Apache Beam :: Runners :: Spark .................... SKIPPED [INFO] Apache Beam :: Runners :: Apex ..................... SKIPPED [INFO] Apache Beam :: Examples ............................ SKIPPED [INFO] Apache Beam :: Examples :: Java .................... SKIPPED [INFO] Apache Beam :: Examples :: Java 8 .................. SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.480 s [INFO] Finished at: 2016-12-28T20:47:11-05:00 [INFO] Final Memory: 26M/162M [INFO] ------------------------------------------------------------------------ |
Choosing a Module
From there, you can choose which module you want to start working with. In my case, I wanted to work with beam-sdks-java-core. From here, we can run a Maven command to start working with that module mvn verify -pl org.apache.beam:beam-sdks-java-core.
Unit Testing
For some of the unit tests in Beam, there are categories. These categories need a runner. In Beam, these are marked with @Category(NeedsRunner.class).
When running unit tests in IntelliJ, you’ll need to make a configuration change. Go to Run->Edit Configurations. Change Use classpath of module to beam-runners-direct-java. This will make the unit test run with the direct runner for the test. The image below shows what it should look like:
![]()
To run a specific unit test from the command line run:
1 2 3 4 | mvn -Dtest=org.apache.beam.sdk.transforms.RegexTest \ -DfailIfNoTests=false \ -pl runners/direct-java -am integration-test |
Using an IDE is by far the easiest way to run individual unit tests.
(Update for improved searching for the error) If you’re getting an error that looks like this:
1 2 3 4 | java.lang.IllegalStateException: The test was annotated with a [@NeedsRunner] / [@ValidatesRunner] while the runner was set to [CrashingRunner]. Please re-check your configuration. |
The fix is to add the -pl or change the classpath as shown above.
Thanks to Dan Halperin for his help.