You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Petr Kuzel (Jira)" <ji...@apache.org> on 2023/05/24 12:27:00 UTC

[jira] [Commented] (CAMEL-19385) generate Error loading other model. Reason: FirstVersion is not specified.

    [ https://issues.apache.org/jira/browse/CAMEL-19385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17725776#comment-17725776 ] 

Petr Kuzel commented on CAMEL-19385:
------------------------------------

Thread from dev@camel mail list:



From: Petr Kuzel <pe...@eurofins.com.INVALID> 
Sent: Wednesday, May 24, 2023 13:55
To: dev@camel.apache.org
Subject: RE: maven generate questions

 

 

 

CAUTION: EXTERNAL EMAIL - Sent from an email domain that is not formally trusted by Eurofins.

 

Do not click on links or open attachments unless you recognise the sender and are certain that the content is safe.

 

Hi Claus,

 

Thx for your peek.

 

My env is \{Windows, JDK 11 + JDK 8, eclipse 2023-03, camel-3.x}.

 

If I recursively delete src/generated/ then maven install fails:

 

  [[1;31mERROR[m] Failed to execute goal [32morg.apache.camel:camel-package-maven-plugin:3.21.0-SNAPSHOT:generate[m [1m(generate)[m on project [36mcamel-azure-files[m: [1;31mError generating data org.apache.maven.plugin.MojoExecutionException: Error loading other model. Reason: java.lang.IllegalArgumentException: FirstVersion is not specified. This can be done in @UriEndpoint or in pom.xml file.[m -> [1m[Help 1][m

 

A workaround is to introduce the marker file under generated:

 

  camel-azure-files/src/generated/resources/META-INF/services/org/apache/camel/component/generate-meta-please

 

Then maven install passes:

 

  [[1;34mINFO[m] [1;32mBUILD SUCCESS

 

 

At the end of a day, we have the same expectation:

src/generated/ should be removable and rebuildable

anytime (& consequently no value to add generated/

to Git, right?).

 

I'm just a bit puzzled that at your end:

 

  cd components/camel-azure/camel-azure-files

  rm -rf src/generated

 

followed by maven install does not fail.

 

  Hope it helps

  Cc.

 

--

  Mr. Petr Kužel, Software Engineer

  Eurofins International Support Services s.à r.l.

  Val Fleuri 23

  L-1526 LUXEMBOURG

 

-----Original Message-----

From: Claus Ibsen <[claus.ibsen@gmail.com|mailto:claus.ibsen@gmail.com]>

Sent: Wednesday, May 24, 2023 11:55

To: [dev@camel.apache.org|mailto:dev@camel.apache.org]

Subject: Re: maven generate questions

 

 

 

CAUTION: EXTERNAL EMAIL - Sent from an email domain that is not formally trusted by Eurofins.

 

Do not click on links or open attachments unless you recognise the sender and are certain that the content is safe.

 

Hi

 

Okay so its a bit weird. What OS are you using?

 

You should always be able to do

 

rm -rf src/generated

 

and rebuild all files again, and have the same result as before if no

changes.

 

 

On Wed, May 24, 2023 at 11:17 AM Petr Kuzel <[petrkuzel@eurofins.com.invalid|mailto:petrkuzel@eurofins.com.invalid]>

wrote:

 

> Hi Claus,

> 

> meanwhile at my side, I have put the build under debugger

> to understand the root cause of my problems.

> 

> My conclusion is commited in

> 

> [https://fra01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpekuz%2Fcamel%2Fcommit%2Fbad98a275c4cf23532f14c1d0f84bcde28ba9059%23diff-4d8489aba647b70b97a7528b634ef5ac309ed85c1d433a7f6e6eaf00f987f219&data=05%7C01%7Cpetrkuzel%40eurofins.com%7C2b198d434b6142c8bcb708db5c4db423%7C5e94ad53ff9d4e369b4c9d99a43d0cca%7C0%7C0%7C638205261031428332%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=lQwY1nUIgFP29yWBCevwZYy63ss3vfq7wTetuZs%2FzEY%3D&reserved=0]

> 

> I could create an issue as IMHO it's a trap

> for newcomers and it reveals fuzziness

> around the generated/ dir. The below #1 was

> just a code smell... but with hours spent

> on overcoming its consequences a relevant one.

> 

>   Hope it helps

>   Cc.

> 

> --

>   Mr. Petr Kužel, Software Engineer

>   Eurofins International Support Services s.à r.l.

>   Val Fleuri 23

>   L-1526 LUXEMBOURG

> 

> -----Original Message-----

> From: Claus Ibsen <[claus.ibsen@gmail.com|mailto:claus.ibsen@gmail.com]>

> Sent: Wednesday, May 24, 2023 09:44

> To: [dev@camel.apache.org|mailto:dev@camel.apache.org]

> Subject: Re: maven generate questions

> 

> 

> 

> CAUTION: EXTERNAL EMAIL - Sent from an email domain that is not formally

> trusted by Eurofins.

> 

> Do not click on links or open attachments unless you recognise the sender

> and are certain that the content is safe.

> 

> Hi

> 

> I can build your project and the code in camel-azure-files

> 

> mvn -V

> Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)

> Maven home: /opt/homebrew/Cellar/maven/3.8.6/libexec

> Java version: 17.0.5, vendor: Azul Systems, Inc., runtime:

> /Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home

> Default locale: en_DK, platform encoding: UTF-8

> OS name: "mac os x", version: "13.3.1", arch: "aarch64", family: "mac"

> 

> And it generates some files for src/generated that you didnt have yet

> 

> 

> 

> On Tue, May 23, 2023 at 11:30 AM Petr Kuzel <petrkuzel@eurofins.com

> .invalid>

> wrote:

> 

> > Hi Claus,

> >

> > I have pushed a wet source in my fork at (deep link):

> >

> >

> [https://fra01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpekuz%2Fcamel%2Ftree%2Fcamel-3.x%2Fcomponents%2Fcamel-azure%2Fcamel-azure-files&data=05%7C01%7Cpetrkuzel%40eurofins.com%7C2b198d434b6142c8bcb708db5c4db423%7C5e94ad53ff9d4e369b4c9d99a43d0cca%7C0%7C0%7C638205261031428332%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=C8MRzbvObpZWp1XGVp3xtbSadXefiTOWaFgsFwsX6wM%3D&reserved=0]

> >

> > For #1, in the fork, src/generated/ is versioned,

> > despite I'm not convinced about adding into Git

> > build-generated sources.

> >

> > For #2, there must be some overlook, but I'm

> > in a state where the error message fails to guide

> > me further, the same for your hint... because I had

> > literally copy-and-pasted the FTPS component

> > and then started adapting it for Azure Files

> > while using the Azure blob component

> > as a secondary source of interesting sources.

> >

> > If you spot a bad or missing annotation

> > that could be at cause let me know, please.

> >

> >   Best regards

> >   Cc.

> >

> > (BTW, there might also a false pull request right on the Camel repo,

> > I used GitHub Desktop in the "to contribute" mode

> > and it by-passed the fork, I tried to reconfigure but ended

> > in an uncertain state, my GitHub Desktop offers Preview PR

> > which includes some parasite commits..., while

> > the fork already contains exactly my two commits.)

> >

> > --

> >   Mr. Petr Kužel, Software Engineer

> >   Eurofins International Support Services s.à r.l.

> >   Val Fleuri 23

> >   L-1526 LUXEMBOURG

> >

> > -----Original Message-----

> > From: Claus Ibsen <[claus.ibsen@gmail.com|mailto:claus.ibsen@gmail.com]>

> > Sent: Monday, May 22, 2023 21:00

> > To: [dev@camel.apache.org|mailto:dev@camel.apache.org]

> > Subject: Re: maven generate questions

> >

> >

> >

> > CAUTION: EXTERNAL EMAIL - Sent from an email domain that is not formally

> > trusted by Eurofins.

> >

> > Do not click on links or open attachments unless you recognise the sender

> > and are certain that the content is safe.

> >

> > Hi

> >

> > When it says "other" then the plugin has not detected that its an

> endpoint

> > component.

> >

> > There are a ton of existing components you can copy from. If you just add

> > the component to camel-3.x branch or main branch etc then its should be

> > easier.

> >

> >

> > On Mon, May 22, 2023 at 6:19 PM Petr Kuzel <petrkuzel@eurofins.com

> > .invalid>

> > wrote:

> >

> > > Hi Camel devs,

> > >

> > > While trying to develop a new Camel component

> > > I’d need an advise, again, on the generate.

> > >

> > > #1

> > > The generate generates a code under src/generated/.

> > > Should it be committed to Git and why, please?

> > > I have seen it committed for other components

> > > but I do not understand why. I have also observed

> > > the generated code is not updated (e.g. after

> > > retyping endpoint URI params) unless I manually delete

> > > previously generated configurers (mvn clean is not enough).

> > >

> > >

> > > #2

> > > I face:

> > >

> > > generate_[m _[1m(generate)_[m on project _[36mcamel-azure-files_[m:

> > >  _[1;31mError generating data

> > > org.apache.maven.plugin.MojoExecutionException:

> > >  Error loading other model. Reason: java.lang.IllegalArgumentException:

> > >  FirstVersion is not specified. This can be done in @UriEndpoint or in

> > > pom.xml file.

> > >

> > > my endpoint code reads:

> > >

> > > @UriEndpoint(firstVersion = "3.21.0", ...

> > > public class FilesEndpoint<T extends ShareFileItem>

> > >  extends RemoteFileEndpoint<ShareFileItem> {

> > >

> > >

> > > Maven debug reports more details:

> > >

> > >  [1mCaused by [m: java.lang.IllegalArgumentException:

> [1;31mFirstVersion

> > > is not specified. This can be done in @UriEndpoint or in pom.xml file.

> [m

> > >      [1mat [m

> > >

> org.apache.camel.maven.packaging.SupportLevelHelper.defaultSupportLevel (

> > > [1mSupportLevelHelper.java:30 [m)

> > >      [1mat [m

> > > org.apache.camel.maven.packaging.PackageOtherMojo.prepareOthers (

> > > [1mPackageOtherMojo.java:132 [m)

> > >      [1mat [m

> > > org.apache.camel.maven.packaging.PrepareComponentMojo.execute (

> > > [1mPrepareComponentMojo.java:152 [m)

> > >      [1mat [m

> > > org.apache.camel.maven.packaging.AbstractGeneratorMojo.execute (

> > > [1mAbstractGeneratorMojo.java:98 [m)

> > >      [1mat [m

> > > org.apache.camel.maven.packaging.PrepareComponentMojo.execute (

> > > [1mPrepareComponentMojo.java:122 [m)

> > >      [1mat [m

> > org.apache.camel.maven.packaging.AbstractGenerateMojo.invoke

> > > ( [1mAbstractGenerateMojo.java:96 [m)

> > >      [1mat [m

> > org.apache.camel.maven.packaging.AbstractGenerateMojo.invoke

> > > ( [1mAbstractGenerateMojo.java:75 [m)

> > >      [1mat [m org.apache.camel.maven.packaging.GenerateMojo.doExecute (

> > > [1mGenerateMojo.java:54 [m)

> > >      [1mat [m

> > > org.apache.camel.maven.packaging.AbstractGenerateMojo.execute (

> > > [1mAbstractGenerateMojo.java:64 [m)

> > >      [1mat [m

> > > org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (

> > > [1mDefaultBuildPluginManager.java:137 [m)

> > >

> > > The error message does not help me to identify

> > > what "other" class it found and fails to process.

> > >

> > > Any clues, please?

> > >

> > >   Regards

> > >   Cc.

> > >

> > > --

> > >   Mr. Petr Kužel, Software Engineer

> > >   Eurofins International Support Services s.à r.l.

> > >   Val Fleuri 23

> > >   L-1526 LUXEMBOURG

> > >

> > >

> >

> > --

> > Claus Ibsen

> > -----------------

> > @davsclaus

> > Camel in Action 2: [https://fra01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.manning.com%2Fibsen2&data=05%7C01%7Cpetrkuzel%40eurofins.com%7C2b198d434b6142c8bcb708db5c4db423%7C5e94ad53ff9d4e369b4c9d99a43d0cca%7C0%7C0%7C638205261031428332%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=gH1I2%2BwZ65VKILs9dSnXLmkA0BJpy4skvgnC8z7D55c%3D&reserved=0]

> >

> 

> 

> --

> Claus Ibsen

> -----------------

> @davsclaus

> Camel in Action 2: [https://fra01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.manning.com%2Fibsen2&data=05%7C01%7Cpetrkuzel%40eurofins.com%7C2b198d434b6142c8bcb708db5c4db423%7C5e94ad53ff9d4e369b4c9d99a43d0cca%7C0%7C0%7C638205261031428332%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=gH1I2%2BwZ65VKILs9dSnXLmkA0BJpy4skvgnC8z7D55c%3D&reserved=0]

> 

 

 

--

Claus Ibsen

-----------------

@davsclaus

Camel in Action 2: [https://fra01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.manning.com%2Fibsen2&data=05%7C01%7Cpetrkuzel%40eurofins.com%7C2b198d434b6142c8bcb708db5c4db423%7C5e94ad53ff9d4e369b4c9d99a43d0cca%7C0%7C0%7C638205261031584556%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=1ULws6WfxRYpOjzdKNpL5RbmYHbYADzNk54yoHhVTYQ%3D&reserved=0]

> generate Error loading other model. Reason: FirstVersion is not specified.
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-19385
>                 URL: https://issues.apache.org/jira/browse/CAMEL-19385
>             Project: Camel
>          Issue Type: Bug
>          Components: build system
>    Affects Versions: 3.21.0
>         Environment: Windows
>            Reporter: Petr Kuzel
>            Priority: Major
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> cd components/camel-azure/camel-azure-storage-blob
> rm -rf src/generated
> maven install
>  
> {color:#000000}[{color}{color:#c50f1f}{color}{color:#c50f1f}ERROR{color}{color:#000000}{color}{color:#000000}] Failed to execute goal {color}{color:#13a10e}{color}{color:#13a10e}org.apache.camel:camel-package-maven-plugin:3.21.0-SNAPSHOT:generate{color}{color:#000000}{color}{color:#000000} {color}{color:#000000}{color}{color:#000000}(generate){color}{color:#000000}{color}{color:#000000} on project {color}{color:#3a96dd}{color}{color:#3a96dd}camel-azure-storage-blob{color}{color:#000000}{color}{color:#000000}: {color}{color:#c50f1f}{color}{color:#c50f1f}Error generating data org.apache.maven.plugin.MojoExecutionException: Error loading other model. Reason: java.lang.IllegalArgumentException: FirstVersion is not specified. This can be done in @UriEndpoint or in pom.xml file.{color}{color:#000000}{color}{color:#000000} -> {color}{color:#000000}{color}{color:#000000}[Help 1]{color}{color:#000000}{color}
>  
> Above is a distillation of the problem using pre-existing component. I got into that trap when developing a new component from scratch.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)