Skip to content
Permalink
Browse files
CXFXJC-17 - Multiple Binding Files
  • Loading branch information
coheigea committed Sep 14, 2018
1 parent 550013e commit ee5ced64b16c74bd0ed6d66716eee2245f98d2b0
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 13 deletions.
@@ -214,12 +214,14 @@ public void execute() throws MojoExecutionException {
//ignore
}
}
if (xsdOptions[x].getBindingFile() != null) {
URI bindingURI = mapLocation(xsdOptions[x].getBindingFile());
if ("file".equals(bindingURI.getScheme())) {
long bts = new File(bindingURI).lastModified();
if (bts > srctimestamp) {
srctimestamp = bts;
if (xsdOptions[x].getBindingFiles() != null) {
for (String bf : xsdOptions[x].getBindingFiles()) {
URI bindingURI = mapLocation(bf);
if ("file".equals(bindingURI.getScheme())) {
long bts = new File(bindingURI).lastModified();
if (bts > srctimestamp) {
srctimestamp = bts;
}
}
}
}
@@ -251,7 +253,11 @@ public void execute() throws MojoExecutionException {
}
}
removeMessages(xsdFile);
removeMessages(xsdOptions[x].getBindingFile());
if (xsdOptions[x].getBindingFiles() != null) {
for (String bf : xsdOptions[x].getBindingFiles()) {
removeMessages(bf);
}
}
int i = run(xsdOptions[x], xsdFile, outputDir);
if (i == 0) {
doneFile.delete();
@@ -410,9 +416,11 @@ private String[] getArguments(XsdOption option, String outputDir)
list.add("-p");
list.add(option.getPackagename());
}
if (option.getBindingFile() != null) {
list.add("-b");
list.add(mapLocation(option.getBindingFile()).toString());
if (option.getBindingFiles() != null) {
for (String bf : option.getBindingFiles()) {
list.add("-b");
list.add(mapLocation(bf).toString());
}
}
if (option.getCatalog() != null) {
list.add("-catalog");
@@ -20,17 +20,18 @@
package org.apache.cxf.maven_plugin;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

public class XsdOption {
String xsd;
String xsdDir;
String packagename;
String bindingFile;
File dependencies[];
File redundantDirs[];
boolean extension;
List<String> extensionArgs;
List<String> bindingFiles;
String catalog;

public String getPackagename() {
@@ -52,10 +53,25 @@ public void setXsdDir(String x) {
this.xsdDir = x;
}
public String getBindingFile() {
return bindingFile;
if (bindingFiles != null && !bindingFiles.isEmpty()) {
return bindingFiles.get(0);
}
return null;
}
public void setBindingFile(String bf) {
this.bindingFile = bf;
if (bindingFiles == null) {
bindingFiles = new ArrayList<>();
bindingFiles.add(bf);
} else {
bindingFiles.clear();
bindingFiles.add(bf);
}
}
public List<String> getBindingFiles() {
return bindingFiles;
}
public void setBindingFiles(List<String> bindingFiles) {
this.bindingFiles = bindingFiles;
}
public void setDependencies(File files[]) {
dependencies = files;

0 comments on commit ee5ced6

Please sign in to comment.