首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Maven构建成功,但在目标文件夹中没有结果

Maven构建成功,但在目标文件夹中没有结果
EN

Stack Overflow用户
提问于 2021-03-02 08:08:04
回答 1查看 152关注 0票数 0

首先,我根本没有使用过Maven。

除了没有指定版本之外,我所有的工作都正常,但是当我在pom.xml中指定Maven版本时,它仍然不起作用。

注意:每次运行都显示"Build Success“,但没有一次将完成的jar文件放到目标文件夹中,这是我认为应该发生的情况。

下面是我从eclipse中得到的输出:

代码语言:javascript
运行
复制
[INFO] Scanning for projects...
[INFO] 
[INFO] ---------------< TromboneSMP:VoluntaryPullFromEternity >----------------
[INFO] Building VoluntaryPullFromEternity 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ VoluntaryPullFromEternity ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.1:compile (default-compile) @ VoluntaryPullFromEternity ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 1 source file to C:\Users\Roboverse\eclipse-workspace\VoluntaryPullFromEternity\target\classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ VoluntaryPullFromEternity ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.6.1:testCompile (default-testCompile) @ VoluntaryPullFromEternity ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ VoluntaryPullFromEternity ---
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ VoluntaryPullFromEternity ---
[INFO] Building jar: C:\Users\Roboverse\eclipse-workspace\VoluntaryPullFromEternity\target\VoluntaryPullFromEternity-0.0.1-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ VoluntaryPullFromEternity ---
[INFO] Installing C:\Users\Roboverse\eclipse-workspace\VoluntaryPullFromEternity\target\VoluntaryPullFromEternity-0.0.1-SNAPSHOT.jar to C:\Users\Roboverse\.m2\repository\TromboneSMP\VoluntaryPullFromEternity\0.0.1-SNAPSHOT\VoluntaryPullFromEternity-0.0.1-SNAPSHOT.jar
[INFO] Installing C:\Users\Roboverse\eclipse-workspace\VoluntaryPullFromEternity\pom.xml to C:\Users\Roboverse\.m2\repository\TromboneSMP\VoluntaryPullFromEternity\0.0.1-SNAPSHOT\VoluntaryPullFromEternity-0.0.1-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.045 s
[INFO] Finished at: 2021-03-01T18:46:45-05:00
[INFO] ------------------------------------------------------------------------

这是我的pom.xml:

代码语言:javascript
运行
复制
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>TromboneSMP</groupId>
  <artifactId>VoluntaryPullFromEternity</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <build>
      <plugins>
          <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-compiler-plugin</artifactId>
              <version>3.6.1</version>
              <configuration>
                  <source>1.7</source>
                  <target>1.7</target>
              </configuration>
          </plugin>
      </plugins>
   </build>
   <repositories>
       <repository>
         <id>spigot-repo</id>
         <url>https://hub.spigotmc.org/nexus/content/repositories/public/</url>
       </repository>
   </repositories>
   <dependencies>
       <dependency>
           <groupId>org.spigotmc</groupId>
           <artifactId>spigot-api</artifactId>
           <version>1.16.4-R0.1-SNAPSHOT</version><!--change this value depending on the version-->
           <type>jar</type>
           <scope>provided</scope>
       </dependency>
   </dependencies>
</project>
EN

回答 1

Stack Overflow用户

发布于 2021-03-02 15:10:03

输出结果显示

Building jar: C:\Users\Roboverse\eclipse-workspace\VoluntaryPullFromEternity\target\VoluntaryPullFromEternity-0.0.1-SNAPSHOT.jar

因此,如果您在target中看不到JAR,则可能需要刷新Eclipse。如果可以找到该文件,请查看Windows资源管理器(或与之类似的Linux资源管理器)。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66431470

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档