gradle build failing - possible lombok issue
up vote
1
down vote
favorite
I've installed lombok 1.18.4 for STS.
However, if I try to build my jar in the terminal with ./gradlew clean build
rather than through STS I get this error:
Task :compileJava FAILED
Image.java:12: error: constructor Image() is already defined in class Image
@NoArgsConstructor
^
1 error
I found this page which suggests it's an issue with an older version of lombok. As I seem to have it installed and working through the IDE, is there anything I must do to get this to build in the terminal?
Here is my Image
class code:
package com.greglturnquist.learningspringboot.learningspringboot;
import lombok.Data;
import lombok.NoArgsConstructor;
//tag::code
@Data
@NoArgsConstructor
public class Image {
private int id;
private String name;
public Image(int id, String name) {
this.id = id;
this.name = name;
}
}
//end::code
java spring spring-boot lombok
add a comment |
up vote
1
down vote
favorite
I've installed lombok 1.18.4 for STS.
However, if I try to build my jar in the terminal with ./gradlew clean build
rather than through STS I get this error:
Task :compileJava FAILED
Image.java:12: error: constructor Image() is already defined in class Image
@NoArgsConstructor
^
1 error
I found this page which suggests it's an issue with an older version of lombok. As I seem to have it installed and working through the IDE, is there anything I must do to get this to build in the terminal?
Here is my Image
class code:
package com.greglturnquist.learningspringboot.learningspringboot;
import lombok.Data;
import lombok.NoArgsConstructor;
//tag::code
@Data
@NoArgsConstructor
public class Image {
private int id;
private String name;
public Image(int id, String name) {
this.id = id;
this.name = name;
}
}
//end::code
java spring spring-boot lombok
1
can you updateImage
class code?
– Deadpool
yesterday
probably you have already defined a default no arg Image constructor, so you should remove it if you're using @NoArgsConstructor
– Abdelghani Roussi
yesterday
Apologies. Code updated.
– runnerpaul
yesterday
1
What version of Lombok is defined in your Gradle dependencies? That's the version of the annotation processor that would be used for a command line build, as far as I know.
– Michael Murray
yesterday
Actually, it seems to be 1.16.22 which I believe is the problem version. How do I update dependency versions in Gradle?
– runnerpaul
yesterday
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I've installed lombok 1.18.4 for STS.
However, if I try to build my jar in the terminal with ./gradlew clean build
rather than through STS I get this error:
Task :compileJava FAILED
Image.java:12: error: constructor Image() is already defined in class Image
@NoArgsConstructor
^
1 error
I found this page which suggests it's an issue with an older version of lombok. As I seem to have it installed and working through the IDE, is there anything I must do to get this to build in the terminal?
Here is my Image
class code:
package com.greglturnquist.learningspringboot.learningspringboot;
import lombok.Data;
import lombok.NoArgsConstructor;
//tag::code
@Data
@NoArgsConstructor
public class Image {
private int id;
private String name;
public Image(int id, String name) {
this.id = id;
this.name = name;
}
}
//end::code
java spring spring-boot lombok
I've installed lombok 1.18.4 for STS.
However, if I try to build my jar in the terminal with ./gradlew clean build
rather than through STS I get this error:
Task :compileJava FAILED
Image.java:12: error: constructor Image() is already defined in class Image
@NoArgsConstructor
^
1 error
I found this page which suggests it's an issue with an older version of lombok. As I seem to have it installed and working through the IDE, is there anything I must do to get this to build in the terminal?
Here is my Image
class code:
package com.greglturnquist.learningspringboot.learningspringboot;
import lombok.Data;
import lombok.NoArgsConstructor;
//tag::code
@Data
@NoArgsConstructor
public class Image {
private int id;
private String name;
public Image(int id, String name) {
this.id = id;
this.name = name;
}
}
//end::code
java spring spring-boot lombok
java spring spring-boot lombok
edited yesterday
asked yesterday
runnerpaul
533322
533322
1
can you updateImage
class code?
– Deadpool
yesterday
probably you have already defined a default no arg Image constructor, so you should remove it if you're using @NoArgsConstructor
– Abdelghani Roussi
yesterday
Apologies. Code updated.
– runnerpaul
yesterday
1
What version of Lombok is defined in your Gradle dependencies? That's the version of the annotation processor that would be used for a command line build, as far as I know.
– Michael Murray
yesterday
Actually, it seems to be 1.16.22 which I believe is the problem version. How do I update dependency versions in Gradle?
– runnerpaul
yesterday
add a comment |
1
can you updateImage
class code?
– Deadpool
yesterday
probably you have already defined a default no arg Image constructor, so you should remove it if you're using @NoArgsConstructor
– Abdelghani Roussi
yesterday
Apologies. Code updated.
– runnerpaul
yesterday
1
What version of Lombok is defined in your Gradle dependencies? That's the version of the annotation processor that would be used for a command line build, as far as I know.
– Michael Murray
yesterday
Actually, it seems to be 1.16.22 which I believe is the problem version. How do I update dependency versions in Gradle?
– runnerpaul
yesterday
1
1
can you update
Image
class code?– Deadpool
yesterday
can you update
Image
class code?– Deadpool
yesterday
probably you have already defined a default no arg Image constructor, so you should remove it if you're using @NoArgsConstructor
– Abdelghani Roussi
yesterday
probably you have already defined a default no arg Image constructor, so you should remove it if you're using @NoArgsConstructor
– Abdelghani Roussi
yesterday
Apologies. Code updated.
– runnerpaul
yesterday
Apologies. Code updated.
– runnerpaul
yesterday
1
1
What version of Lombok is defined in your Gradle dependencies? That's the version of the annotation processor that would be used for a command line build, as far as I know.
– Michael Murray
yesterday
What version of Lombok is defined in your Gradle dependencies? That's the version of the annotation processor that would be used for a command line build, as far as I know.
– Michael Murray
yesterday
Actually, it seems to be 1.16.22 which I believe is the problem version. How do I update dependency versions in Gradle?
– runnerpaul
yesterday
Actually, it seems to be 1.16.22 which I believe is the problem version. How do I update dependency versions in Gradle?
– runnerpaul
yesterday
add a comment |
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
Based on your comment about the Gradle version, look for the build.gradle
file for your project.
Find the dependencies section within, and update the line related to lombok to match your STS version
You should see a line similar to this, but with 1.16.22 as the version.
dependencies {
compileOnly('org.projectlombok:lombok:1.18.4')
}
Thanks. I had to edit the code sample you provided but your suggestion worked a treat.
– runnerpaul
yesterday
Feel free to suggest an edit to the answer so it's more correct.
– Michael Murray
yesterday
add a comment |
up vote
1
down vote
Try with the AccessLevel
i'm just going through this issue in github here
@NoArgsConstructor(access=AccessLevel.PUBLIC)
Github Resource From the refered link
Yes, this is a bug. Sorry. Will see how soon we can make a new release.
1.16.22 constructor has private access #1704
OR update to
Update Lombok dependency version to 1.18.2 #14127
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
Based on your comment about the Gradle version, look for the build.gradle
file for your project.
Find the dependencies section within, and update the line related to lombok to match your STS version
You should see a line similar to this, but with 1.16.22 as the version.
dependencies {
compileOnly('org.projectlombok:lombok:1.18.4')
}
Thanks. I had to edit the code sample you provided but your suggestion worked a treat.
– runnerpaul
yesterday
Feel free to suggest an edit to the answer so it's more correct.
– Michael Murray
yesterday
add a comment |
up vote
2
down vote
accepted
Based on your comment about the Gradle version, look for the build.gradle
file for your project.
Find the dependencies section within, and update the line related to lombok to match your STS version
You should see a line similar to this, but with 1.16.22 as the version.
dependencies {
compileOnly('org.projectlombok:lombok:1.18.4')
}
Thanks. I had to edit the code sample you provided but your suggestion worked a treat.
– runnerpaul
yesterday
Feel free to suggest an edit to the answer so it's more correct.
– Michael Murray
yesterday
add a comment |
up vote
2
down vote
accepted
up vote
2
down vote
accepted
Based on your comment about the Gradle version, look for the build.gradle
file for your project.
Find the dependencies section within, and update the line related to lombok to match your STS version
You should see a line similar to this, but with 1.16.22 as the version.
dependencies {
compileOnly('org.projectlombok:lombok:1.18.4')
}
Based on your comment about the Gradle version, look for the build.gradle
file for your project.
Find the dependencies section within, and update the line related to lombok to match your STS version
You should see a line similar to this, but with 1.16.22 as the version.
dependencies {
compileOnly('org.projectlombok:lombok:1.18.4')
}
edited yesterday
runnerpaul
533322
533322
answered yesterday
Michael Murray
447815
447815
Thanks. I had to edit the code sample you provided but your suggestion worked a treat.
– runnerpaul
yesterday
Feel free to suggest an edit to the answer so it's more correct.
– Michael Murray
yesterday
add a comment |
Thanks. I had to edit the code sample you provided but your suggestion worked a treat.
– runnerpaul
yesterday
Feel free to suggest an edit to the answer so it's more correct.
– Michael Murray
yesterday
Thanks. I had to edit the code sample you provided but your suggestion worked a treat.
– runnerpaul
yesterday
Thanks. I had to edit the code sample you provided but your suggestion worked a treat.
– runnerpaul
yesterday
Feel free to suggest an edit to the answer so it's more correct.
– Michael Murray
yesterday
Feel free to suggest an edit to the answer so it's more correct.
– Michael Murray
yesterday
add a comment |
up vote
1
down vote
Try with the AccessLevel
i'm just going through this issue in github here
@NoArgsConstructor(access=AccessLevel.PUBLIC)
Github Resource From the refered link
Yes, this is a bug. Sorry. Will see how soon we can make a new release.
1.16.22 constructor has private access #1704
OR update to
Update Lombok dependency version to 1.18.2 #14127
add a comment |
up vote
1
down vote
Try with the AccessLevel
i'm just going through this issue in github here
@NoArgsConstructor(access=AccessLevel.PUBLIC)
Github Resource From the refered link
Yes, this is a bug. Sorry. Will see how soon we can make a new release.
1.16.22 constructor has private access #1704
OR update to
Update Lombok dependency version to 1.18.2 #14127
add a comment |
up vote
1
down vote
up vote
1
down vote
Try with the AccessLevel
i'm just going through this issue in github here
@NoArgsConstructor(access=AccessLevel.PUBLIC)
Github Resource From the refered link
Yes, this is a bug. Sorry. Will see how soon we can make a new release.
1.16.22 constructor has private access #1704
OR update to
Update Lombok dependency version to 1.18.2 #14127
Try with the AccessLevel
i'm just going through this issue in github here
@NoArgsConstructor(access=AccessLevel.PUBLIC)
Github Resource From the refered link
Yes, this is a bug. Sorry. Will see how soon we can make a new release.
1.16.22 constructor has private access #1704
OR update to
Update Lombok dependency version to 1.18.2 #14127
edited yesterday
answered yesterday
Deadpool
3,0362324
3,0362324
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53401078%2fgradle-build-failing-possible-lombok-issue%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
can you update
Image
class code?– Deadpool
yesterday
probably you have already defined a default no arg Image constructor, so you should remove it if you're using @NoArgsConstructor
– Abdelghani Roussi
yesterday
Apologies. Code updated.
– runnerpaul
yesterday
1
What version of Lombok is defined in your Gradle dependencies? That's the version of the annotation processor that would be used for a command line build, as far as I know.
– Michael Murray
yesterday
Actually, it seems to be 1.16.22 which I believe is the problem version. How do I update dependency versions in Gradle?
– runnerpaul
yesterday