私は目標mvn packageを使用してmavenプロジェクトをビルドしようとしています。プロジェクトをビルドすると、2つのjarファイルがgeneartedになります。demo-lwm2m-client-1.0-jar- .jarと他のdemo-lwm2m-client-1.0.jar.Now私はsrc/main/resourcesに配置されたファイルにいくつかの変更を加えてプロジェクトを再構築すると、demo-lwm2m-client-1.0-jar -with-dependencies.jarは、demo-lwm2m-client-1.0.jarがchanges.Howを反映している間に、コードで行った変更を反映していません。依存関係jar.Belowのコード変更が反映されています。 http://maven.apache.org/xsd/maven-4.0.0.xsd "> 4.0.0maven build dependency jarファイルがコードの変更を反映していない
<groupId>com.demo.lwm2m.client</groupId>
<artifactId>demo-lwm2m-client</artifactId>
<packaging>jar</packaging>
<version>1.0</version>
<name>DemoLwm2mClient</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.eclipse.leshan</groupId>
<artifactId>leshan-client-cf</artifactId>
<version>1.0.0-M1</version>
</dependency>
<dependency>
<groupId>com.appiot.examples</groupId>
<artifactId>simulatedplatform</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.5</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>eclipse</id>
<url>https://repo.eclipse.org/content/repositories/leshan-snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<mainClass>com.demo.lwm2m.MainClass</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
mvnパッケージを試してみてください。 –
@SudhaVelan – prem