您的問題在具有資源的示例項目上重現。運行 - > Maven Clean具有後面提到的輸出,僅涵蓋清理。
雖然最新版本不提供這個screen,但我猜目標process-resources
仍然運行,它會在運行任何Maven任務時將資源複製到輸出目錄。
我想知道爲什麼,當Sonatype書中提到它時,插件仍然沒有顯示這些選項。
在我的以前的項目,我們用來去除process-resources
從目標運行時更新項目配置以避免資源加工爲主要任務是從命令行處理。
希望這會有所幫助。
P.S:我不認爲你的問題與你改變部署目錄有什麼關係。
Apache Maven 3.0.4 (r1232337; 2012-01-17 14:14:56+0530)
Maven home: C:\projects\workspace\abc\EMBEDDED
Java version: 1.7.0_04, vendor: Oracle Corporation
Java home: C:\Java\jre7
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from EMBEDDED\conf\settings.xml
[DEBUG] Reading user settings from C:\Users\stackoverflow\.m2\settings.xml
[DEBUG] Using local repository at C:\Users\stackoverflow\.m2\repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for C:\Users\stackoverflow\.m2\repository
[INFO] Scanning for projects...
[DEBUG] Extension realms for project abc:abc:jar:0.0.1-SNAPSHOT: (none)
[DEBUG] Looking up lifecyle mappings for packaging jar from ClassRealm[plexus.core, parent: null]
[DEBUG] === REACTOR BUILD PLAN ================================================
[DEBUG] Project: abc:abc:jar:0.0.1-SNAPSHOT
[DEBUG] Tasks: [clean]
[DEBUG] Style: Regular
[DEBUG] =======================================================================
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Test 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] === PROJECT BUILD PLAN ================================================
[DEBUG] Project: abc:abc:0.0.1-SNAPSHOT
[DEBUG] Dependencies (collect): []
[DEBUG] Dependencies (resolve): []
[DEBUG] Repositories (dependencies): [central (http://repo.maven.apache.org/maven2, releases)]
[DEBUG] Repositories (plugins) : [central (http://repo.maven.apache.org/maven2, releases)]
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal: org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean (default-clean)
[DEBUG] Style: Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
<directory default-value="${project.build.directory}"/>
<excludeDefaultDirectories default-value="false">${clean.excludeDefaultDirectories}</excludeDefaultDirectories>
<failOnError default-value="true">${maven.clean.failOnError}</failOnError>
<followSymLinks default-value="false">${clean.followSymLinks}</followSymLinks>
<outputDirectory default-value="${project.build.outputDirectory}"/>
<reportDirectory default-value="${project.reporting.outputDirectory}"/>
<skip default-value="false">${clean.skip}</skip>
<testOutputDirectory default-value="${project.build.testOutputDirectory}"/>
<verbose>${clean.verbose}</verbose>
</configuration>
[DEBUG] =======================================================================
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ abc ---
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG] Imported: org.apache.maven.wagon.events < plexus.core
...
Lots of such lines
...
[DEBUG] Imported: org.codehaus.plexus.* < plexus.core
[DEBUG] Imported: org.codehaus.plexus.personality < plexus.core
[DEBUG] Populating class realm maven.api
[DEBUG] org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1:
[DEBUG] org.apache.maven:maven-plugin-api:jar:2.0.6:compile
[DEBUG] org.codehaus.plexus:plexus-utils:jar:2.0.5:compile
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-clean-plugin:2.4.1
[DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-clean-plugin:2.4.1
[DEBUG] Imported: < maven.api
[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-clean-plugin:2.4.1
[DEBUG] Included: org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1
[DEBUG] Included: org.codehaus.plexus:plexus-utils:jar:2.0.5
[DEBUG] Excluded: org.apache.maven:maven-plugin-api:jar:2.0.6
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-clean-plugin:2.4.1, parent: [email protected]]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-clean-plugin:2.4.1:clean' with basic configurator -->
[DEBUG] (f) directory = C:\projects\rollbase2.0workspace\abc\target
[DEBUG] (f) excludeDefaultDirectories = false
[DEBUG] (f) failOnError = true
[DEBUG] (f) followSymLinks = false
[DEBUG] (f) outputDirectory = C:\projects\rollbase2.0workspace\abc\target\classes
[DEBUG] (f) reportDirectory = C:\projects\rollbase2.0workspace\abc\target\site
[DEBUG] (f) skip = false
[DEBUG] (f) testOutputDirectory = C:\projects\rollbase2.0workspace\abc\target\test-classes
[DEBUG] -- end configuration --
[DEBUG] Skipping non-existing directory C:\projects\rollbase2.0workspace\abc\target
[DEBUG] Skipping non-existing directory C:\projects\rollbase2.0workspace\abc\target\classes
[DEBUG] Skipping non-existing directory C:\projects\rollbase2.0workspace\abc\target\test-classes
[DEBUG] Skipping non-existing directory C:\projects\rollbase2.0workspace\abc\target\site
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.693s
[INFO] Finished at: Sun Sep 01 16:38:36 IST 2013
[INFO] Final Memory: 4M/121M
[INFO] ------------------------------------------------------------------------
@Ben你爲什麼要刪除[tag:clean]標籤? – durron597
因爲它不夠具體;有多少種語言具有「乾淨」功能等?它會被錯誤的原因使用它立即變得不堪重負。我想你可以添加一個'[maven-clean]'或'[mvn-clean]',但是請不要使用如此通用的東西。 – Ben
這是如何更容易? –