mirror of
https://github.com/apache/maven-mvnd.git
synced 2025-09-26 23:45:47 +00:00
Move BuildProperties to the client (#630)
This commit is contained in:
@@ -74,6 +74,21 @@
|
|||||||
</resource>
|
</resource>
|
||||||
</resources>
|
</resources>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>buildnumber-maven-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<locale>en_US</locale>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>validate</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>create</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>io.takari.maven.plugins</groupId>
|
<groupId>io.takari.maven.plugins</groupId>
|
||||||
<artifactId>takari-lifecycle-plugin</artifactId>
|
<artifactId>takari-lifecycle-plugin</artifactId>
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.mvndaemon.mvnd.common;
|
package org.mvndaemon.mvnd.client;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
@@ -41,7 +41,6 @@ import org.apache.maven.cli.internal.extension.model.CoreExtension;
|
|||||||
import org.apache.maven.cli.internal.extension.model.io.xpp3.CoreExtensionsXpp3Reader;
|
import org.apache.maven.cli.internal.extension.model.io.xpp3.CoreExtensionsXpp3Reader;
|
||||||
import org.codehaus.plexus.util.StringUtils;
|
import org.codehaus.plexus.util.StringUtils;
|
||||||
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
|
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
|
||||||
import org.mvndaemon.mvnd.common.BuildProperties;
|
|
||||||
import org.mvndaemon.mvnd.common.Environment;
|
import org.mvndaemon.mvnd.common.Environment;
|
||||||
import org.mvndaemon.mvnd.common.Os;
|
import org.mvndaemon.mvnd.common.Os;
|
||||||
import org.mvndaemon.mvnd.common.SocketFamily;
|
import org.mvndaemon.mvnd.common.SocketFamily;
|
||||||
|
@@ -39,7 +39,6 @@ import org.fusesource.jansi.Ansi;
|
|||||||
import org.fusesource.jansi.internal.CLibrary;
|
import org.fusesource.jansi.internal.CLibrary;
|
||||||
import org.jline.utils.AttributedString;
|
import org.jline.utils.AttributedString;
|
||||||
import org.jline.utils.AttributedStyle;
|
import org.jline.utils.AttributedStyle;
|
||||||
import org.mvndaemon.mvnd.common.BuildProperties;
|
|
||||||
import org.mvndaemon.mvnd.common.DaemonException;
|
import org.mvndaemon.mvnd.common.DaemonException;
|
||||||
import org.mvndaemon.mvnd.common.DaemonInfo;
|
import org.mvndaemon.mvnd.common.DaemonInfo;
|
||||||
import org.mvndaemon.mvnd.common.DaemonRegistry;
|
import org.mvndaemon.mvnd.common.DaemonRegistry;
|
||||||
@@ -187,11 +186,10 @@ public class DefaultClient implements Client {
|
|||||||
if (version || showVersion || debug) {
|
if (version || showVersion || debug) {
|
||||||
// Print mvnd version
|
// Print mvnd version
|
||||||
BuildProperties buildProperties = BuildProperties.getInstance();
|
BuildProperties buildProperties = BuildProperties.getInstance();
|
||||||
final String mvndVersionString = "mvnd "
|
final String mvndVersionString = "mvnd " + buildProperties.getVersion() + " "
|
||||||
+ (Environment.isNative() ? "native client " : "JVM client ")
|
+ (Environment.isNative()
|
||||||
+ buildProperties.getVersion()
|
? buildProperties.getOsName() + "-" + buildProperties.getOsArch() + " native client"
|
||||||
+ "-" + buildProperties.getOsName()
|
: "JVM client")
|
||||||
+ "-" + buildProperties.getOsArch()
|
|
||||||
+ " (" + buildProperties.getRevision() + ")";
|
+ " (" + buildProperties.getRevision() + ")";
|
||||||
|
|
||||||
boolean isColored = !"never".equals(Environment.MAVEN_COLOR.getCommandLineOption(args));
|
boolean isColored = !"never".equals(Environment.MAVEN_COLOR.getCommandLineOption(args));
|
||||||
|
@@ -16,7 +16,6 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
revision=${buildNumber}
|
revision=${buildNumber}
|
||||||
timestamp=${timestamp}
|
|
||||||
version=${project.version}
|
version=${project.version}
|
||||||
os.detected.name=${os.detected.name}
|
os.detected.name=${os.detected.name}
|
||||||
os.detected.arch=${os.detected.arch}
|
os.detected.arch=${os.detected.arch}
|
@@ -59,29 +59,7 @@
|
|||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<resources>
|
|
||||||
<resource>
|
|
||||||
<directory>${basedir}/src/main/resources</directory>
|
|
||||||
<filtering>true</filtering>
|
|
||||||
</resource>
|
|
||||||
</resources>
|
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
|
||||||
<artifactId>buildnumber-maven-plugin</artifactId>
|
|
||||||
<configuration>
|
|
||||||
<locale>en_US</locale>
|
|
||||||
<timestampFormat>{0,date,yyyy-MM-dd'T'HH:mm:ssX}</timestampFormat>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<phase>validate</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>create</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.mvndaemon.mvnd</groupId>
|
<groupId>org.mvndaemon.mvnd</groupId>
|
||||||
<artifactId>mvnd-build-maven-plugin</artifactId>
|
<artifactId>mvnd-build-maven-plugin</artifactId>
|
||||||
|
@@ -40,10 +40,13 @@ public class VersionNativeIT {
|
|||||||
client.execute(output, "-v").assertSuccess();
|
client.execute(output, "-v").assertSuccess();
|
||||||
|
|
||||||
output.assertContainsMatchingSubsequence(
|
output.assertContainsMatchingSubsequence(
|
||||||
"\\Qmvnd " + (isNative() ? "native client " : "JVM client ")
|
"\\Qmvnd "
|
||||||
+ System.getProperty("project.version")
|
+ System.getProperty("project.version")
|
||||||
+ "-" + System.getProperty("os.detected.name")
|
+ " "
|
||||||
+ "-" + System.getProperty("os.detected.arch")
|
+ (isNative()
|
||||||
|
? System.getProperty("os.detected.name")
|
||||||
|
+ "-" + System.getProperty("os.detected.arch") + " native client"
|
||||||
|
: "JVM client")
|
||||||
+ "\\E",
|
+ "\\E",
|
||||||
"\\QMaven home: " + parameters.mvndHome() + "\\E");
|
"\\QMaven home: " + parameters.mvndHome() + "\\E");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user