diff --git a/src/main/java/com/wangym/lombok/job/impl/MavenDependencyVersionReplaceJob.java b/src/main/java/com/wangym/lombok/job/impl/MavenDependencyVersionReplaceJob.java index 39329db..aa25ee6 100644 --- a/src/main/java/com/wangym/lombok/job/impl/MavenDependencyVersionReplaceJob.java +++ b/src/main/java/com/wangym/lombok/job/impl/MavenDependencyVersionReplaceJob.java @@ -88,14 +88,15 @@ public void process() { .map(it->it.getDependencies()) .orElse(Collections.emptyList()) .forEach(this::processDependency); - List dep2 = getDependencyOfDependencyManagement(); - for (Iterator iterator = dep2.iterator(); iterator.hasNext(); ) { - Dependency dependency = iterator.next(); - //在依赖管理器中的版本不能为空,这样会导致依赖出错 - if (dependency.getVersion() == null) { - iterator.remove(); - } - } + //因为${project.version}的声明,在读取的时候,会当做null的版本来处理,这样的依赖是不能去除的 +// List dep2 = getDependencyOfDependencyManagement(); +// for (Iterator iterator = dep2.iterator(); iterator.hasNext(); ) { +// Dependency dependency = iterator.next(); +// //在依赖管理器中的版本不能为空,这样会导致依赖出错 +// if (dependency.getVersion() == null) { +// iterator.remove(); +// } +// } // 删除重复的依赖声明 deleteDuplicateDependencies(model.getDependencies());