-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add a BOM to our generated pom.xml files #2956
Changes from 2 commits
ba21bd9
fa8fcdd
c790e19
4b9fef5
2e9c983
23dfbc8
29347c5
9786405
02eb29f
a9393fd
31a4275
c681b6e
43dc5b3
234a4a6
144552e
3122b9d
eaa4315
ac9cb01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -199,6 +199,12 @@ private static void createPomXml(IProject project, AppEngineProjectConfig config | |
properties.put("projectArtifactId", config.getMavenArtifactId()); //$NON-NLS-1$ | ||
properties.put("projectVersion", config.getMavenVersion()); //$NON-NLS-1$ | ||
|
||
String bomVersion = getCurrentVersion( | ||
"com.google.cloud", //$NON-NLS-1$ | ||
"google-cloud", //$NON-NLS-1$ | ||
"0.40.0-alpha"); //$NON-NLS-1$ | ||
properties.put("googleCloudJavaVersion", bomVersion); //$NON-NLS-1$ | ||
|
||
String mavenPluginVersion = getCurrentVersion( | ||
"com.google.cloud.tools", //$NON-NLS-1$ | ||
"appengine-maven-plugin", //$NON-NLS-1$ | ||
|
@@ -208,7 +214,7 @@ private static void createPomXml(IProject project, AppEngineProjectConfig config | |
String sdkVersion = getCurrentVersion( | ||
"com.google.appengine", //$NON-NLS-1$ | ||
"appengine-api-1.0-sdk", //$NON-NLS-1$ | ||
"1.9.62"); //$NON-NLS-1$ | ||
"1.9.63"); //$NON-NLS-1$ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's worth pulling these artifact constants (including the BOM artifact too) out into explicit constants rather than have them scattered in the code. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense. Can you file an issue for that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
properties.put("appEngineApiSdkVersion", sdkVersion); //$NON-NLS-1$ | ||
|
||
if (isStandardProject) { | ||
|
@@ -229,6 +235,9 @@ private static void createPomXml(IProject project, AppEngineProjectConfig config | |
|
||
private static String getCurrentVersion(String group, String artifact, String defaultVersion) { | ||
ArtifactVersion version = ArtifactRetriever.DEFAULT.getLatestReleaseVersion(group, artifact); | ||
if (version == null) { // there is no release version | ||
version = ArtifactRetriever.DEFAULT.getLatestVersion(group, artifact); | ||
} | ||
if (version == null) { | ||
return defaultVersion; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,4 +70,5 @@ public static String getEclipseVersion() { | |
return "_(failed to get bundle \"org.eclipse.platform\")_"; | ||
} | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,18 @@ | |
<prerequisites> | ||
<maven>3.3.9</maven> | ||
</prerequisites> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.google.cloud</groupId> | ||
<artifactId>google-cloud</artifactId> | ||
<version>${googleCloudJavaVersion}</version> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<dependencies> | ||
<!-- Compile/runtime dependencies --> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be simplified using XPath as in
PomXmlValidator
?