Usage ExpansionDiff
nsdiff <expansionSettings_1> <expansionSettings_2> [OPTIONS]
| Argument | Description |
|---|---|
expansionSettings_1 | Path to the "before" expansionSettings file. |
expansionSettings_2 | Path to the "after" expansionSettings file. |
If both expansion settingsExpansion Settings (ExpansionSettings). The core XML configuration file specifying model locations, target expansion output directories, and expansion resources. files point to the same expansion directory, the tool logs a message and exits immediately, since no diffs could ever be found in that case.
Options
| Option | Default | Description |
|---|---|---|
-f, --pomXml <file> | pom.xml | Pom file to expand with. |
--skipExpansion | false | Skip expansion and only compare the (already expanded) output directories. |
--noCleanExpansion | false | Run the expansions without the clean flag, instead of the default clean expansion. |
-e, --exclude <pattern> | (none) | Filter out files matching a glob pattern (relative file path). See Excluded files |
--simplify | false | Reduce the number of diffs for the same expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. by grouping diffs that have the same size together. |
--merge | false | Collapse all diffs for the same expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. into a single entry. |
--format <AUTO|DIFF|MARKDOWN> | AUTO | Output format. AUTO picks MARKDOWN when the output file ends in .md, and DIFF otherwise (including when writing to the console). |
-o, --output <file> | (none) | File to write the output to. If omitted, the output is written to stdout. When the format resolves to MARKDOWN and the file name doesn't already end in .md, that extension is appended automatically. Parent directories are created if needed. |
-h, --help | Prints documentation. | |
-V, --version | Prints the version of the applicationApplicationThe overarching model container grouping all components, domain logic, and configurations for an enterprise solution.. |
Examples
Compare two expansion settingsExpansion Settings (ExpansionSettings). The core XML configuration file specifying model locations, target expansion output directories, and expansion resources. files, expanding both first, and print the diff to the console:
nsdiff conf/expansionSettings.xml conf/revisedExpansionSettings.xml
Write the result as a Markdown report:
nsdiff conf/expansionSettings.xml conf/revisedExpansionSettings.xml -o report.md
Ignore javascript files:
nsdiff conf/expansionSettings.xml conf/revisedExpansionSettings.xml -e "*.js"
Group similar diffs from the same expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact. into a single entry:
nsdiff conf/expansionSettings.xml conf/revisedExpansionSettings.xml --simplify
Excluded files
Use the -e, --exclude <pattern> option to exclude files using a glob pattern. Supports *, **, ? and comma-separated alternatives, e.g. **/*.log,**/generated/**.
Some file types are not possible to diff and some directories contain diffs that are not relevant. Therefore files such
as binaries and some directories are excluded regardless of the --exclude option. Below is a list of these default
exclusions:
- File extensions:
.bin,.bmp,.doc,.docx,.eot,.gif,.ico,.jpeg,.jpg,.otf,.odt,.pdf,.pfx,.png,.tar.gz,.tiff,.ttf,.webm,.webp,.woff,.woff2,.zip - Directories (path contains):
/struts/styles/,/struts/js/lib/,/struts/images/,/target/,/.expansion-manifest/
Output
Here is an example of the markdown output.
File Diffs
original: conf\expansionSettings.xml
revised: conf\expansionSettings_revised.xml
File exclusion pattern: ``
Default excluded file extensions: .bin, .bmp, .doc, .docx, .eot, .gif, .ico, .jpeg, .jpg, .otf, .odt, .pdf, .pfx, .png, .tar.gz, .tiff, .ttf, .webm, .webp, .woff, .woff2, .zip
Default excluded directories: /struts/styles/, /struts/js/lib/, /struts/images/, /target/, /.expansion-manifest/
113 different files
Diff DataAccessData.java
original expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact.: net.democritus.expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact..jpa.dataElement.DataExpander
revised expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact.: net.democritus.expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact..jpa.dataElement.DataExpander
similar files: 81
--- <applicationName>/components/account/data/gen/jpa/src/net/democritus/acl/DataAccessData.java
+++ <applicationName>/components/account/data/gen/jpa/src/net/democritus/acl/DataAccessData.java
@@ -2,11 +2,10 @@
// expanded with nsx-expanders:8.5.0, expansionResource net.democritus:data-layer-jpa-expanders:1.6.0
+// anchor:imports:start
import java.util.ArrayList;
import java.util.Collection;
import net.democritus.sys.DataRef;
-
-// anchor:imports:start
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Column;
Diff pom.xml
original expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact.: net.democritus.expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact..maven.applicationApplicationThe overarching model container grouping all components, domain logic, and configurations for an enterprise solution..ApplicationRootPomExpander
revised expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact.: net.democritus.expanderExpanderA unit of generation that combines a data tree instance (functional M1 model) with a template to generate an artifact..maven.applicationApplicationThe overarching model container grouping all components, domain logic, and configurations for an enterprise solution..ApplicationRootPomExpander
similar files: 0
--- <applicationName>/pom.xml
+++ <applicationName>/pom.xml
@@ -21,7 +21,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <expanders.version>9.2.0</expanders.version>
+ <expanders.version>9.5.0</expanders.version>
<!-- @anchor:properties:start -->
<javaee.version>8.0.1</javaee.version>
<falcon-logic-cruds-repository.version>1.2.0</falcon-logic-cruds-repository.version>
@@ -371,13 +371,13 @@
<dependency>
<groupId>net.democritus</groupId>
<artifactId>application-shared-menu</artifactId>
- <version>9.2.0</version>
+ <version>9.5.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.democritus</groupId>
<artifactId>application-shared-common</artifactId>
- <version>9.2.0</version>
+ <version>9.5.0</version>
<scope>compile</scope>
</dependency>
<dependency>
@@ -431,7 +431,7 @@
<dependency>
<groupId>net.democritus</groupId>
<artifactId>web-shared-servlets</artifactId>
- <version>2026.0.0</version>
+ <version>2026.5.0</version>
<scope>compile</scope>
</dependency>
...